<%@ page language="java" contentType="text/html;charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/taglib.jsp"%>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>智能尿液监控系统</title>
<link rel="stylesheet" type="text/css" href="${ctx }/static/css/degreelisten.css">
<link rel="stylesheet" type="text/css" href="${ctx }/static/css/normalize.css">
<link rel="stylesheet" type="text/css" href="${ctx }/static/css/common.css"> 
<link rel="shortcut icon" href="../images/c_temperature.png"/>
<script type="text/javascript" src="${ctx }/static/js/jquery.min.js"></script>
<script src="${ctx }/highcharts/highstock-all.js"></script>
<%-- <script src="${ctx }/modules/exporting.js"></script> --%>
<script src="${ctx }/highcharts/modules/exporting.js"></script>
<script src="${ctx }/static/js/common.js"></script>
<script src="${ctx }/static/js/My97DatePicker/WdatePicker.js"></script>
<script src="${ctx }/static/js/layer/layer.js"></script>
<style>
</style>
</head>
<body>
<audio id="snd" src="" autoplay="true" width=0  height=0 loop="true"></audio>

	<div id="page">
		<div class="header">
			<div class="headermain clearfix">
				<!-- <div class="logo"></div> -->
				<div style="position:absolute;top:10px;left:20px;background: url('..${logoPath }') #52b5ff no-repeat;width: 200px; height: 40px;"></div>
				<center style="height: 60px;">
					<span
						style="font-size: 24px; color: #FFFFFF; top: 25%; position: relative;">智能尿液监控系统</span>
						<span style="font-size:12px;color:#FFFFFF;float:right;margin-top:30px;margin-left:0px;">v1.1.1.20151129_ release</span>
				</center>
				<%-- div class="logininfo"><span>${user_attr.realName }</span><input id="user_attr_id" type="hidden" value="${user_attr.id }"></div> --%>
			</div>
			
		</div>
		<div class="main">
			<div class="menulist">
				<ul style="padding: 0px; margin: 0px">
					<li>
						<div class="mainmenu">
							<span class="mainmenucontent"
								style="background: url(../images/icon_temperature_monitor.png) no-repeat 0px 3px; padding-left: 25px; line-height: 60px;">
								尿液监控 </span>
							<hr style="margin-top: -10px; margin-left: 5px; width: 100px; height: 1px; border: none; border-top: 1px solid #555555;" />
						</div>
					</li>

					<li>
						<div id="showunnormal" class="menulv2">
							<span id="unnormalTemperature" class="highandlowcount"
								style="display: block; width: 120px; text-align: center; font-size: 60px; color: orange; line-height: 40px; padding-top: 40px">4</span><br />
							<span
								style="display: block; width: 120px; text-align: center; font-size: 14px; color: #FFFFFF">尿量异常</span>
						</div>
					</li>

					<li>
						<div id="shownormal" class="menulv2 menuclicked">
							<span id="unnormalTemperature"
								style="display: block; width: 120px; text-align: center; font-size: 60px; color: green; line-height: 40px; padding-top: 40px">
								<span class="notemptycount">18</span><span style="font-size: 25px; color: #FFFFFF">/<span class="totalcount">20</span></span>
							</span><br /> 
							<span style="display: block; width: 120px; text-align: center; font-size: 14px; color: #FFFFFF">床位信息</span>
						</div>
					</li>

					<li>
						<div id="docManage" class="mainmenu">
							<hr
								style="margin-top: 0px; margin-left: 5px; width: 100px; height: 1px; border: none; border-top: 1px solid #555555;" />
							<span class="mainmenucontent"
								style="background: url(../images/icon_files_manage.png) no-repeat 0px 3px; padding-left: 25px; line-height: 60px;">
								档案管理 </span>
							<hr
								style="margin-top: -11px; margin-left: 5px; width: 100px; height: 1px; border: none; border-top: 1px solid #555555;" />
						</div>
					</li>
					<li>
						<div id="concentratorManage" class="mainmenu">
							<hr
								style="margin-top: 0px; margin-left: 5px; width: 100px; height: 1px; border: none; border-top: 1px solid #555555;" />
							<span class="mainmenucontent"
								style="background: url(../images/icon_setting.png) no-repeat 0px 3px; padding-left: 25px; line-height: 60px;">
								设备管理 </span>
							<hr
								style="margin-top: -11px; margin-left: 5px; width: 100px; height: 1px; border: none; border-top: 1px solid #555555;" />
						</div>
					</li>
				</ul>
				<div style="width:120px;height:50px;position:absolute;bottom:20px;text-align:center;">
					<span style="font-size:14px;">账号：${user_attr.realName }</span><input id="user_attr_id" type="hidden" value="${user_attr.id }">
					<hr style="margin-top: 5px;  width: 100px; height: 1px; border: none; border-top: 1px solid #555555;" />
					<a href="../home/logOut.action" style="text-decoration:none;font-size:14px;color:#FFFFFF;padding-left:20px;background:url(../images/icon_logout.png) no-repeat 0 3px">退出登录</a><!-- <span onclick="logOut();" style="cursor:pointer;font-size:14px;padding-left:20px;background:url(../images/icon_logout.png) no-repeat 0 3px">退出登录</span> -->
				</div>
			</div>
			<!-- 主要显示区域 -->
			<div class="mainArea" style="position:fixed;left:120px;top:60px">
				<div class="pageConcentratorManage">
					<div class="divheader4Concentrator">
						<div
							style="font-size: 24px; color: #33A684; margin-left: 30px; display: block; position: relative; top: 26px">
							设备管理<font id="concentratorNum4Doc" style="font-size: 14px;"
								color="#666666">当前个集中器</font>
						</div>
						<div
							style="margin-right: 30px; position: relative; right: 30px; float: right; color: #3CB397;cursor:pointer;"
							class="btnDiv4AddConcentrator"  onclick="addConcentrator()">
							<span class="btnSpan4AddConcentrator"
								style="background: url(../images/icon_add_patient_small.png) no-repeat;">添加集中器</span>
						</div>
						<hr
							style="width: auto; height: 1px; border: none; margin: 46 30 0 30; position: relative; border-top: 1px solid #33A684;" />
					</div>
					<center>
					<table class="concentratorlistbox" border="1" cellspacing="0" style="margin: 18 0 18 30;  position: relative;" cellpadding="0">
						<tr style="background: #D5F5DF;">
							<td align="center"><span class="tab_b">病床号码</span></td>
							<td align="center"><span class="tab_b">集中器号码</span></td>
							<td align="center"><span class="tab_b">功能操作</span></td>
						</tr>
					</table>
					</center>
				</div>
				<!-- 档案管理相关 -->
				<!-- <div class="pageDocManage">
					<div class="divheader4DocManage">
						<div
							style="font-size: 24px; color: #33A684; margin-left: 30px; display: block; position: relative; top: 26px">
							档案管理<font id="patientNum4Doc" style="font-size: 14px;"
								color="#666666">当前位患者</font>
						</div>
						<div
							style="margin-right: 30px; position: relative; right: 30px; float: right; color: #3CB397;"
							class="btnDiv4Doc" onclick="addPatient4btn()">
							<span class="btnSpan4Deg"
								style="background: url(../images/icon_add_patient_small.png) no-repeat;">患者入住</span>
						</div>
						<hr
							style="width: auto; height: 1px; border: none; margin: 46 30 0 30; position: relative; border-top: 1px solid #33A684;" />
					</div>
					<table class="listbox" border="1" cellspacing="0"
						style="margin: 18 0 18 30; width: 90%; positon: relative;"
						cellpadding="0">
						<tr style="background: #D5F5DF;">
							<td align="center"><span class="tab_b">病床号码</span></td>
							<td align="center"><span class="tab_b">患者姓名</span></td>
							<td align="center"><span class="tab_b">性别/年龄</span></td>
							<td align="center"><span class="tab_b">医师诊断</span></td>
							<td align="center"><span class="tab_b">病案号码</span></td>
							<td align="center"><span class="tab_b">温度监控起始时间</span></td>
							<td align="center"><span class="tab_b">贴片号码</span></td>
							<td align="center"><span class="tab_b">实时温度</span></td>
							<td align="center"><span class="tab_b">功能操作</span></td>
						</tr>
					</table>
					<div class="pageManage"
						style="width: auto; height: 24px; float: right;">
						<div class="pagePrev4Doc"></div>
						<div class="pageNum4Doc">1/1</div>
						<div class="pageNext4Doc"></div>
					</div>
				</div> -->
				
				
				<!-- <div  style="height:92px;width:100%;margin-left:30px;">
				<ul style="list-style:none;padding:0px;margin:0px;">
					<li class="" style="height:48px;width:140px;margin:24 0 20 0;display:inline;float:left;" >
						<span style=" width: 140px; text-align: center; font-size: 48px; color: orange;">
								<span class="highcount">1</span><span style="font-size: 14px; color: #FFFFFF">位患者体温过高</span>
						</span>
 					</li>
 				</ul>
			</div>
			<div style="height:auto;width:100%;margin-left:20px">
				<ul id="bedList4high" style="list-style:none;padding:0px;margin:0px;"></ul>
			</div>
			
			<div  style="height:48px;width:100%;margin-left:30px;margin-top:54px;margin-bottom:20px;position:relative;float:left">
				<ul style="list-style:none;padding:0px;margin:0px;">
 					<li class="" style="height:48px;width:140px;margin:0;display:inline;float:left;backround:red">
 						<span style=" width: 140px; text-align: center; font-size: 48px; color: #1295FE;">
							<span class="lowcount">2</span><span style="font-size: 14px; color: #FFFFFF">位患者体温过低</span>
						</span>
 					</li>
 				</ul>
			</div>
			<div style="height:auto;width:100%;margin-left:20px;margin-top:20px">
				<ul id="bedList4low" style="list-style:none;padding:0px;margin:0px;"></ul>
			</div> -->
			 <!-- 床位统计信息以及按钮等 -->
			<!-- <div id="bedstatistic" style="height:130px;width:100%;margin-left:10px;">
			<ul style="list-style:none;padding:0px;margin:0px;">
			<li class="statisticLi" >
			<span style="margin-left:46px; width: 140px; text-align: center; font-size: 48px; color: orange;">
								<span class="highcount"></span><span style="font-size: 14px; color: #FFFFFF">位</span>
							</span>
							<span style="display: block; width: 140px; text-align: center; font-size: 14px; color: #FFFFFF">患者体温过高</span>
 			</li>
 			<li class="statisticLi">
 			<span style="margin-left:46px; width: 140px; text-align: center; font-size: 48px; color: #1295FE;">
								<span class="lowcount"></span><span style="font-size: 14px; color: #FFFFFF">位</span>
							</span>
							<span style="display: block; width: 140px; text-align: center; font-size: 14px; color: #FFFFFF">患者体温过低</span>
 			</li>
 			
 			<li class="statisticLi">
 			<span style="margin-left:46px; width: 140px; text-align: center; font-size: 48px; color: #FFFFFF;">
								<span class="notemptycount"></span><span style="font-size: 14px; color: #FFFFFF">位</span>
							</span>
							<span style="display: block; width: 140px; text-align: center; font-size: 14px; color: #FFFFFF">患者入住</span>
 			</li>
 			
 			<li class="statisticLi">
 			<span style="margin-left:46px; width: 140px; text-align: center; font-size: 48px; color: #FFFFFF;">
								<span class="emptycount"></span><span style="font-size: 14px; color: #FFFFFF">个</span>
							</span>
							<span style="display: block; width: 140px; text-align: center; font-size: 14px; color: #FFFFFF">床位空置</span>
 			</li>
 			
 			<li class="statisticLi">
 			<span style="margin-left:46px; width: 140px; text-align: center; font-size: 48px; color: #FFFFFF;">
								<span class="totalcount"></span><span style="font-size: 14px; color: #FFFFFF">个</span>
							</span>
							<span style="display: block; width: 140px; text-align: center; font-size: 14px; color: #FFFFFF">当前总计床位</span>
 			</li>
 			
 			<li class="btnAddBedLi4Deg">
 			<div class="btnDiv4Deg" onclick="addBed()">
				<span class="btnSpan4Deg" style="background: url(../images/icon_add_sickbed_small.png) no-repeat;">添加床位</span>
			</div>
 			</li>66
 			
 			<li class="btnAddBedLi4Deg">
 			<div class="btnDiv4Deg" onclick="addPatient4btn()">
				<span class="btnSpan4Deg" style="background: url(../images/icon_add_patient_small.png) no-repeat;">患者入住</span>
			</div>
 			</li>
 			</ul>
			</div>
			床位列表区域
			<div class="bedsArea">
				<ul id="bedList" style="list-style:none;padding:0px;margin:0px;">
				非空床位
				<li class="bedLi">
					<div class="normal4bed">
						<span class="curDegreeSpan" >36.88℃</span>
						<span class="patientNameSpan">宋志伟</span><br>
						<span class="patientAgeSpan">男  28岁</span>
					</div>
					<div class="divbed_bedNum">
						<div class="div4BedNum">
							<span class="span4BedNum">床位号：</span>
							<span class="span4BedNum">2001</span>
						</div>
						<div>
							<div class="smallbtnRecInBedList4div" >
								<span class="span4Rec">记录</span>
							</div>
							<div class="smallbtnDelInBedList4div" >
								<span class="span4Del">删除</span>
							</div>
						</div>
					</div>
				</li >
				
				空床位
				<li class="bedLi">
					<div class="addPatient4bed">
						<span class="addPatientSpan">患者入住</span>
					</div>
					<div class="divbed_bedNum">
						<div class="div4BedNum">
							<span class="span4BedNum">床位号：</span>
							<span class="span4BedNum">2001</span>
						</div>
						<div>
							<div class="smallbtnDelInEmptyBed4div" >
								<span class="span4Del">删除</span>
							</div>
						</div>
					</div>
				</li>
				
				添加床位
				<li class="bedLi">
					<div class="addBed4bed"></div>
					<div class="divbed_bedNum" style="position:relative;">
						<div id="addBedInList4div" class="addBedInBedsList" >
						<center>
				 			<span id="addBedInLists4pan">添加床位</span></center>
						</div>
					</div>
				</li>
				</ul>
			</div>
			</div> -->
		</div>
	</div>
	<script>
		$(document).ready(function(){
/* 			$('body').width(window.innerWidth);
			$('body').height(window.innerHeight); */
			//alert(document.body.scrollHeight);
			$(".menulist").css("height",document.body.scrollHeight-60);
			$(".mainArea").css("height",document.body.scrollHeight-60).css("width",document.body.scrollWidth-120);
			/*  $(".mainArea").empty(); */ 
			addBasicInfo();
			getBedsData();
			startAutoRefresh();//自动刷新页面 
			//每隔一段时间获取一次集中器异常状态
			setInterval("getNosignedConcentrator()", 600000);
		});
		window.onresize = function(){
			location.reload(true);
			if(nowPageType==0){
            	getBedsData();
            }else if(nowPageType==1){
            	getPatientListData();
            	//$("#showunnormal").trigger("click");
            }else{
            	getBedsDataOfUnnormal();
            	//location.reload(true);
            }
			
		}
		function getNosignedConcentrator(){
			$.ajax({
				 type:"post",
	              url:"../concentrator/getNosignedConcentrator.action",//此处返回true或false
	              dataType:"text",
	              data:{"userId":$("#user_attr_id").val()},
	              success:function(data){
	              var objResult=JSON.parse(data);
	            	  if(objResult.success&&!ifwarning){
							document.getElementById("snd").volume=0.5;
							ifwarning=true;
							$("#snd").attr('src','../static/sound/super.wav');
							setTimeout("indexalert=layer.alert('"+objResult.bedName+"床的集中器连接异常，请检查设备!',{closeBtn: 0},function(){$(\"#snd\").attr('src','');ifwarning=false;stopWarning4Concentrator('"+objResult.macs+"');layer.close(indexalert);})",500);
	            	  }
	              }
			});
		}
		//开始自动刷新
		function startAutoRefresh(){
			clearTimeout(autorefresh);
			autorefresh = setInterval("getBedsData()", 5000);//自动刷新页面
		}
		//停止页面自动刷新
		function stopAutoRefresh() {
			clearTimeout(autorefresh);
		}
		//开始自动刷新
		function startAutoRefresh4Unnormal(){
			clearTimeout(autorefresh4Unnormal);
			autorefresh4Unnormal = setInterval("getBedsDataOfUnnormal()", 5000);//自动刷新页面
		}
		//停止页面自动刷新
		function stopAutoRefresh4Unnormal() {
			clearTimeout(autorefresh4Unnormal);
		}
		//开始自动刷新
		function startAutoRefresh4Patient(){
			clearTimeout(autorefresh4Patient);
			autorefresh4Patient = setInterval("getPatientListData()", 600000);//自动刷新页面
		}
		//停止页面自动刷新
		function stopAutoRefresh4Patient() {
			clearTimeout(autorefresh4Patient);
		}
		function startAutoRefresh4Concentrator(){
			clearTimeout(autorefresh4Concentrator);
			autorefresh4Concentrator= setInterval("getConcentratorListData()", 600000);//自动刷新页面
		}
		//停止页面自动刷新
		function stopAutoRefresh4Concentrator() {
			clearTimeout(autorefresh4Concentrator);
		}
		//集中器停止报警
		function stopWarning4Concentrator(strmacs){//stopwarning
			$.ajax({
				type:"post",
				url:"../concentrator/stopwarning.action",
				dataType:"json",
				data:{"strmacs":strmacs},
				success:function(data){

				},
				error:function(){

				}
			})
		}
		//档案管理分页相关
		var pageSize = 15; //每页显示个数
        var nowpage = 1; //当前第几页
        var totalPages = 1;
        var pageSize4C = 15; //每页显示个数
        var nowpage4C = 1; //当前第几页
        var totalPages4C = 1;
		function getPatientListData(){
			$(".patientListbox").empty();
             $.ajax({
              type:"post",
              url:"../patient/list.action",//此处返回true或false
              dataType:"json",
              data:{"pageNo":nowpage,"pageSize":pageSize,"userId":$("#user_attr_id").val(),"patientName":$(".name4SearchPatient").val()},
              success:function(data){
            	  $("#patientNum4Doc").text('当前'+(data.total==undefined?0:data.total)+'位患者');
                   if(data.total%pageSize != 0){
                       totalPages = data.total==undefined?1:(parseInt(data.total/pageSize) +1);
                   }else{
                       totalPages =  data.total==undefined?1:(parseInt(data.total/pageSize));
                   }
                   $(".pageNum4Doc").html('<input type="text" id="newPageNo" onchange="changePatientPage(this.value);"  onkeyup="fillNumOnly(this)" style="font-size:14px;width:24px; height:20px;" value="'+nowpage+'">'+''+'/'+totalPages);
                   //putPatientsData(data.rows);//onkeyup="this.value=this.value.replace(/[^0-9]/g,\"\");"
                   //$("#header4PatientTable").append('');patientListbox
                   $(".patientListbox").empty();
                   $(".patientListbox").append('<tr id="header4PatientTable" style="background: #D5F5DF;">'
				+'<td align="center"><span class="tab_b">病案号码</span></td>'
				+'<td align="center"><span class="tab_b">患者姓名</span></td>'
				+'<td align="center"><span class="tab_b">性别/年龄</span></td>'
				//+'<td align="center"><span class="tab_b">医师诊断</span></td>'
				+'<td align="center"><span class="tab_b">病床号码</span></td>'
				+'<td align="center"><span class="tab_b">温度监控起始时间</span></td>'
				+'<td align="center"><span class="tab_b">贴片号码</span></td>'
				+'<td align="center"><span class="tab_b">实时尿量</span></td>'
				+'<td align="center"><span class="tab_b">发送指令</span></td>'
				+'<td align="center"><span class="tab_b">功能操作</span></td></tr>');
					var className4PatientListTr="";
                    $(data.rows).each(function(index,dom){
                    	if(dom.status==0){
                    		className4PatientListTr="historyPatientTr";
                    	}else{
                    		className4PatientListTr="currentPatientTr";
                    	}
                     $(".patientListbox").append('  <tr class="'+className4PatientListTr+'">'+//style=" border-bottom:1px solid #e4ebf1"
                     '<td align="center"><span class="tab_b">'+dom.sickid+'</span></td>'+
                     '<td align="center"><span class="tab_b" style="cursor:pointer;" onclick="showDegree(this);" bedid="'+dom.bedid+'">'+dom.name+'</span></td>'+
                     '<td align="center"><span class="tab_b">'+dom.sex+'/'+dom.age+'</span></td>'+
                     //'<td align="center"><span class="tab_b">'+dom.diagnosis+'</span></td>'+
                     '<td align="center"><span class="tab_b">'+dom.bedid+'</span></td>'+
                     '<td align="center"><span class="tab_b">'+dom.startTime+'</span></td>'+
                     '<td align="center"><span class="tab_b">'+dom.cardnum+'</span></td>'+
                     '<td align="center"><span class="tab_b">'+((dom.ny==undefined||dom.ny<34)?'34.00':dom.ny)+'</span></td>'+
                     '<td align="center"><span class="tab_b"><input name="msg" type="text"></span></td>'+
                     '<td align="center" style="color:#1295FE">'+
                     '<span class="btnUpdatePatient" onclick="sendCMD(this);" mac="'+dom.cardnum+'">发送</span>&nbsp;|&nbsp;'+
                     '<span class="btnUpdatePatient" onclick="updatePatient(this);" personnelId="'+dom.id+'">修改</span>&nbsp;|&nbsp;<span class="btnUpdatePatient" bedName="'+dom.bedid+'"  personnelId="'+dom.id+'" onclick="delPatient(this);">删除</span></td>'+
                     '</tr>');
                    })
              }
             })
         }
		function sendCMD(obj){
			var mac=$(obj).attr("mac");
			var cmd=$(obj).parent().siblings().find("input[name=msg]").val().trim();
			if(cmd.length!=2&&cmd.length!=1){
				layer.alert("请正确填写命令！");return;
			}
			if(mac.length!=12){
				layer.alert("mac地址错误！");return;
			}
			$.ajax({
				type:"post",
				url:"../patient/sendCMD.action",
				dataType:"json",
				data:{"mac":mac,"cmd":cmd},
				success:function(data){
					if(data==true){
						layer.msg('发送成功', {
							time : 2000
						})
					}else{
						layer.msg('发送失败', {
							time : 2000
						})
					}
				
				},
				error : function() {
					layer.msg('发送失败', {
						time : 2000
					})
				}
			})
		}
		function changePatientPage(newPageNo) {
			if (newPageNo > totalPages || newPageNo == 0
					|| newPageNo == nowpage) {
				$("#newPageNo").val(nowpage);
				return;
			} else {
				nowpage = newPageNo;
				getPatientListData();
			}
		}

		//档案管理上一页
		function pagePrev() {
			if (nowpage == 1) {
				return;
			} else {
				nowpage--;
			}
			getPatientListData();
		}
		//档案管理下一页
		function pageNext() {
			if (nowpage == totalPages) {
				return;
			} else {
				nowpage++;
			}
			getPatientListData();
		}
		//档案管理上一页
		function pagePrev4Concentrator() {
			if (nowpage4C == 1) {
				return;
			} else {
				nowpage4C--;
			}
			getConcentratorListData();
		}
		//档案管理下一页
		function pageNext4Concentrator() {
			if (nowpage4C == totalPages4C) {
				return;
			} else {
				nowpage4C++;
			}
			getConcentratorListData();
		}
		$(".menulv2").click(function() {
			nowPageType = 0;
			$("#concentratorManage").removeClass("menuclicked");
			$(".menulv2").removeClass("menuclicked");
			$("#docManage").removeClass("menuclicked");
			$(this).addClass("menuclicked");
		});
		/* $("#docManage").click(function() {
			
			
		}); */
		$("#showunnormal")
				.click(
						function() {//显示温度异常页面
							stopAutoRefresh();
							stopAutoRefresh4Patient();
							stopAutoRefresh4Concentrator();
							$(".mainArea").empty();
							$(".mainArea")
									.html(
											'<div  style="height:92px;width:100%;margin-left:30px;"><ul style="list-style:none;padding:0px;margin:0px;">'
													+ '<li class="" style="height:48px;width:160px;margin:24 0 20 0;display:inline;float:left;" ><span style=" width: 140px; text-align: center; font-size: 48px;'+
			' color: orange;"><span class="highcount">1</span><span style="font-size: 14px; color: #FFFFFF">位患者尿量过多</span></span></li></ul></div>'
													+ '<div style="height:auto;width:100%;margin-left:20px"><ul id="bedList4high" style="list-style:none;padding:0px;margin:0px;"></ul></div>'
													+ '<div  style="height:48px;width:100%;margin-left:30px;margin-top:54px;margin-bottom:20px;position:relative;float:left"><ul style="list-style:none;padding:0px;'+
			'margin:0px;"><li class="" style="height:48px;width:160px;margin:0;display:inline;float:left;backround:red"><span style=" width: 140px; text-align: center;'+
			' font-size: 48px; color: #1295FE;"><span class="lowcount">2</span><span style="font-size: 14px; color: #FFFFFF">位患者尿量过少</span></span></li></ul></div>'
													+ '<div style="height:auto;width:100%;margin-left:20px;margin-top:20px"><ul id="bedList4low" style="list-style:none;padding:0px;margin:0px;"></ul></div>');
							startAutoRefresh4Unnormal();
							getBedsDataOfUnnormal();
						});
		$("#shownormal").click(function() {//显示温度监控页面（床位列表）
			stopAutoRefresh4Unnormal();
			stopAutoRefresh4Patient();
			stopAutoRefresh4Concentrator();
			startAutoRefresh();
			$(".mainArea").empty();
			addBasicInfo();
			getBedsData();
		});
		function addBasicInfo() {
			$(".mainArea")
					.html(
							'<div id="bedstatistic" style="height:130px;width:100%;margin-left:10px;"><ul style="list-style:none;padding:0px;'+
					'margin:0px;"><li class="statisticLi" ><span style="margin-left:46px; width: 140px; text-align: center; font-size: 48px; color: orange;">'
									+ '<span class="highcount"></span><span style="font-size: 14px; color: #FFFFFF">位</span></span><span style="display: block; width: 140px; '+
					'text-align: center; font-size: 14px; color: #FFFFFF">患者尿量过多</span></li><li class="statisticLi"><span style="margin-left:46px; width: 140px;'+
					' text-align: center; font-size: 48px; color: #1295FE;"><span class="lowcount"></span><span style="font-size: 14px; color: #FFFFFF">位</span></span>'
									+ '<span style="display: block; width: 140px; text-align: center; font-size: 14px; color: #FFFFFF">患者尿量过少</span></li><li class="statisticLi">'
									+ '<span style="margin-left:46px; width: 140px; text-align: center; font-size: 48px; color: #FFFFFF;"><span class="notemptycount"></span><span style="font-size: 14px;'+
					' color: #FFFFFF">位</span></span><span style="display: block; width: 140px; text-align: center; font-size: 14px; color: #FFFFFF">患者入住</span></li>'
									+ '<li class="statisticLi"><span style="margin-left:46px; width: 140px; text-align: center; font-size: 48px; color: #FFFFFF;">'
									+ '<span class="emptycount"></span><span style="font-size: 14px; color: #FFFFFF">个</span></span><span style="display: block; width: 140px; text-align: center;'+
					' font-size: 14px; color: #FFFFFF">床位空置</span></li><li class="statisticLi"><span style="margin-left:46px; width: 140px; text-align: center; font-size: 48px;'+
					' color: #FFFFFF;"><span class="totalcount"></span><span style="font-size: 14px; color: #FFFFFF">个</span></span><span style="display: block; width: 140px; '+
					'text-align: center; font-size: 14px; color: #FFFFFF">当前总计床位</span></li><li class="btnAddBedLi4Deg"><div class="btnDiv4Deg" onclick="addBed()"><span class="btnSpan4Deg" '
									+ 'style="background: url(../images/icon_add_sickbed_small.png) no-repeat;">添加床位</span></div></li><li class="btnAddBedLi4Deg">'
									+ '<div class="btnDiv4Deg" onclick="addPatient4btn()"><span class="btnSpan4Deg" style="background: url(../images/icon_add_patient_small.png) no-repeat;">患者入住</span></div></li></ul></div>'
									+ '<div class="bedsArea"><ul id="bedList" style="list-style:none;padding:0px;margin:0px;"></ul></div>');
		}
		$("#docManage")
				.click(
						function() {
							//用于点击病人名称显示折线图
							$.ajax({
								type : "post",
								url : "listAll4Patients.action",
								dataType : "json",
								data : {},
								success : function(data) {
									//$(".totalcount").html(data.total);
									bedsinfo = data.data;
									bedsOtherinfo = data.otherdata;
									$(bedsinfo).each(function(index, dom) {
										bedsBasicinfo[dom.bedid] = dom;
									})
								},
								error : function() {
									$(".totalcount").html(0);
									bedsinfo = [];
									bedsOtherinfo = [];
								}
							})
							stopAutoRefresh();
							stopAutoRefresh4Unnormal();
							stopAutoRefresh4Concentrator();
							$(this).addClass("menuclicked");
							$("#concentratorManage").removeClass("menuclicked");
							$(".menulv2").removeClass("menuclicked");
							$(".mainArea").empty();
							$(".mainArea")
									.html(
											'<div class="pageDocManage"><div class="divheader4DocManage"><div style="font-size:24px;color:#33A684;margin-left:30px;display:block;position:relative;top:26px">档案管理&nbsp;<font id="patientNum4Doc" style="font-size:14px;" color="#666666">当前位患者</font>'
													+ '</div><div style="margin-right:30px;position:relative;right:30px;float:right;color:#3CB397;cursor:pointer;" class="btnDiv4Doc" onclick="addPatient4btn()">'
													+ '<span class="btnSpan4Deg" style="background: url(../images/icon_add_patient_small_green.png) no-repeat;">患者入住</span></div>'
													+ '<hr style="width: auto; height: 1px; border: none;margin: 46 30 0 30;position:relative; border-top: 1px solid #33A684;" />'
													+ '</div><table class="patientListbox" border="1" cellspacing="5" style="font-size:14px;border:1px solid #666666;margin:18 0 18 30;width:90%;positon:relative;" cellpadding="5">'
													+ '<tr id="header4PatientTable" style="background: #D5F5DF;">'
													+ '<td align="center"><span class="tab_b">病案号码</span></td>'
													+ '<td align="center"><span class="tab_b">患者姓名</span></td>'
													+ '<td align="center"><span class="tab_b">性别/年龄</span></td>'
													//+'<td align="center"><span class="tab_b">医师诊断</span></td>'
													+ '<td align="center"><span class="tab_b">病床号码</span></td>'
													+ '<td align="center"><span class="tab_b">温度监控起始时间</span></td>'
													+ '<td align="center"><span class="tab_b">贴片号码</span></td>'
													+ '<td align="center"><span class="tab_b">实时尿量</span></td>'
													+ '<td align="center"><span class="tab_b">发送指令</span></td>'
													+ '<td align="center"><span class="tab_b">功能操作</span></td></tr></table>'
													+ '<div class="pageManage" style="width:auto;height:24px;float:right;margin-right:30px;"><div class="pagePrev4Doc" onclick="pagePrev()"></div>'
													+ '<div class="pageNum4Doc" ><input type="text" style="font-size:14px;width:24px; height:20px;" readonly="true" value="1">/1</div><div class="pageNext4Doc" onclick="pageNext()"></div></div>'
													+ '<div style="font-size:14px;float:right;margin-right:20px;"><span>姓名：</span><input class="name4SearchPatient" onchange="refreshPatientList();" style="border-radius: 10px;width:100px;height:24px;padding-left:10px;padding-right:10px;" type="text"></div>'
													+ '</div>');
							//去后台请求所有病人信息数据
							$(".pageDocManage").width(
									$(".mainArea").width() - 60).height(
									$(".mainArea").height() - 60);
							$(".patientListbox").css("width",
									$(".pageDocManage").width() - 60);
							getPatientListData();
							startAutoRefresh4Patient();

						});

		$("#concentratorManage")
				.click(
						function() {

							nowPageType = 1;
							stopAutoRefresh();
							stopAutoRefresh4Unnormal();
							stopAutoRefresh4Patient();
							$(this).addClass("menuclicked");
							$("#docManage").removeClass("menuclicked");
							$(".menulv2").removeClass("menuclicked");
							$(".mainArea").empty();
							$(".mainArea")
									.html(
											'<div class="pageConcentratorManage">'
													+ '<div class="divheader4Concentrator">'
													+ '<div style="font-size: 24px; color: #33A684; margin-left: 30px; display: block; position: relative; top: 26px">'
													+ '设备管理<font id="concentratorNum4Doc" style="font-size: 14px;"color="#666666">当前个集中器</font>'
													+ '</div>'
													+ '<div style="margin-right: 30px; position: relative; right: 30px; float: right; color: #3CB397;cursor:pointer;"'
													+ 'class="btnDiv4AddConcentrator"  onclick="addConcentrator()">'
													+ '<span class="btnSpan4AddConcentrator" style="background: url(../images/icon_add_concentrator.png) no-repeat;">添加集中器</span>'
													+ '</div>'
													+ '<hr style="width: auto; height: 1px; border: none; margin: 46 30 0 30; position: relative; border-top: 1px solid #33A684;" />'
													+ '</div>'
													+ '<center>'
													+ '<table class="concentratorlistbox" border="1" cellspacing="0" style="margin: 18 0 18 30;  position: relative;" cellpadding="0">'
													+ '<tr style="background: #D5F5DF;">'
													+ '<td align="center"><span class="tab_b">病床号码</span></td>'
													+ '<td align="center"><span class="tab_b">集中器号码</span></td>'
													+ '<td align="center"><span class="tab_b">集中器状态</span></td>'
													+ '<td align="center"><span class="tab_b">功能操作</span></td>'
													+ '</tr>'
													+ '</table>'
													+ '<div class="pageManage" style="width:auto;height:24px;float: left;margin-left:490px;"><div class="pagePrev4Doc" onclick="pagePrev4Concentrator()"></div>'
													+ '<div class="pageNum4Doc" ><input type="text" style="font-size:14px;width:24px; height:20px;" readonly="true" value="1">/1</div><div class="pageNext4Doc" onclick="pageNext4Concentrator()"></div></div>'
													+ '</center>' + '</div>');
							//去后台请求所有病人信息数据
							$(".pageConcentratorManage").width(
									$(".mainArea").width() - 60).height(
									$(".mainArea").height() - 60);
							$(".pageManage")
									.css(
											'margin-left',
											$(".pageConcentratorManage")
													.width() / 2 + 180);
							getConcentratorListData();
							startAutoRefresh4Concentrator();

						});
		function updateConcentrator(id, bedName, concentratorNo) {
			$(".title4Concentrator").text("修改集中器");
			$('.modelbg').show();
			$('#id4UpConcentrator').val(id);
			$(".concentratorNo").val(concentratorNo);
			$(".bedid4Concentrator").val(bedName);
			$(".addconcentratorbox").show();

		}
		//确认添加或修改集中器信息，并保存
		function sureAddConcentrator() {
			var id = $('#id4UpConcentrator').val();
			var bedName = $(".bedid4Concentrator").val();
			var concentratorNo = $(".concentratorNo").val();
			if (bedName.trim().length == 0 || concentratorNo.trim().length == 0) {
				layer.alert("请正确填写参数！");
				return;
			}
			var paras = {
				"bedName" : bedName,
				"concentratorNo" : concentratorNo
			};
			if (id.length > 0) {
				paras = {
					"id" : id,
					"bedName" : bedName,
					"concentratorNo" : concentratorNo
				}
			}
			$.ajax({
				type : "post",
				url : "../concentrator/add.action",//��Ӳ�����Ϣ
				dataType : "json",
				data : paras,//{"medicalTreatmentType":sicktype,"personnelId":personid,"address":address,"id":patientid,"name":name,"sex":sex,"age":age,"bedName":bedid,//"bed.id":idofbed,
				//"disease":sickname,"doctor":doctor,"equipNo":cardname,"rangeEnd":highc,"rangeStart":lowc,"startTime":startTime},
				//data:{"medicalTreatmentType":sicktype,"personnelId":personid,"address":address,"id":patientid,"name":name,"sex":sex,"age":age,"startTime":roomtime,
				//"disease":sickname,"doctor":doctor,"equipNo":cardname,"rangeEnd":highc,"rangeStart":lowc},//,"bed_id":idofbed//2015-11-28 10:01:43
				success : function(data) {
					if (data.success == false) {
						//alert(data.bedstatus);
						layer.alert("保存失败，请重试！");
						return;
					}
					$('.addconcentratorbox').hide();
					$('.modelbg').hide();
					getConcentratorListData();
				}

			})
		}
		var toDeleteConcentratorId;//将要删除的集中器的id
		function deleteConcentrator(id) {
			toDeleteConcentratorId = id;
			var index = layer.open({
				type : 2,
				area : [ '360px', '240px' ],
				fix : true, //不固定
				maxmin : false,
				content : [ '../static/layerHtml/delConConfirm.html', 'no' ],
				scrollbar : false,
				closeBtn : 0,
				title : false,
				shade : [ 0.5, '#000000' ]
			//0.1透明度的白色背景
			});
			layer.style(index, {
				'border-radius' : '4px'
			});
		}
		//添加集中器
		function addConcentrator() {
			$(".title4Concentrator").text("添加集中器");
			$('.modelbg').show();
			$('#id4UpConcentrator').val('');
			$(".concentratorNo").val("");
			$(".bedid4Concentrator").val("");
			$(".addconcentratorbox").show();
		}
		function getConcentratorListData() {
			$
					.ajax({
						type : "post",
						url : "../concentrator/list.action",//此处返回true或false
						dataType : "json",
						data : {
							"pageNo" : nowpage4C,
							"pageSize" : pageSize4C
						},
						success : function(data) {
							$("#concentratorNum4Doc").text(
									'当前' + data.total + '个集中器');
							if (data.total % pageSize4C != 0) {
								totalPages4C = parseInt(data.total / pageSize4C) + 1;
							} else {
								totalPages4C = parseInt(data.total / pageSize4C);
							}
							//$(".pageNum4Doc").text(nowpage+'/'+(totalPages==0?1:totalPages));
							$(".pageNum4Doc")
									.html(
											'<input type="text" id="newPageNo" onchange="changeConcentratorPage(this.value);"  onkeyup="fillNumOnly(this)" style="font-size:14px;width:24px; height:20px;" value="'
													+ nowpage4C
													+ '">'
													+ ''
													+ '/'
													+ (totalPages4C == 0 ? 1
															: totalPages4C));
							//putPatientsData(data.rows);
							//$("#header4PatientTable").append('');patientListbox
							$(".concentratorlistbox").empty();
							$(".concentratorlistbox")
									.append(
											'<tr style="background: #D5F5DF;">'
													+ '<td align="center"><span class="tab_b">病床号码</span></td>'
													+ '<td align="center"><span class="tab_b">集中器号码</span></td>'
													+ '<td align="center"><span class="tab_b">集中器状态</span></td>'
													+ '<td align="center"><span class="tab_b">功能操作</span></td>'
													+ '</tr>');
							console.dir(data);

							$(data.rows)
									.each(
											function(index, dom) {
												$(".concentratorlistbox")
														.append(
																'  <tr >'
																		+ //style=" border-bottom:1px solid #e4ebf1"
																		'<td align="center"><span class="tab_b">'
																		+ dom.bedName
																		+ '</span></td>'
																		+ '<td align="center"><span class="tab_b">'
																		+ dom.concentratorNo
																		+ '</span></td>'
																		+ '<td align="center"><span class="tab_b">'
																		+ (dom.signaled == 1 ? "正常"
																				: "异常")
																		+ '</span></td>'
																		+ '<td align="center" style="color:#1295FE"><span class="btnUpdateUser" '
																		+ 'onclick="updateConcentrator(\''
																		+ dom.id
																		+ '\',\''
																		+ dom.bedName
																		+ '\',\''
																		+ dom.concentratorNo
																		+ '\');">修改</span>'
																		+ '&nbsp;|&nbsp;<span class="btnUpdateUser" onclick="deleteConcentrator(\''
																		+ dom.id
																		+ '\');">删除</span></td>'
																		+ '</tr>');
											})
						}
					})
		}
		function changeConcentratorPage(newPageNo) {
			if (newPageNo > totalPages4C || newPageNo == 0
					|| newPageNo == nowpage4C) {
				$("#newPageNo").val(nowpage4C);
				return;
			} else {
				nowpage4C = newPageNo;
				getConcentratorListData();
			}
		}
		//搜索姓名文本框内容改变后刷新病人列表
		function refreshPatientList() {
			getPatientListData();
		}
		//温度监控页面相关
		var bedsinfo = {};//当前所有病床的信息
		var bedsBasicinfo = {};
		var bedsOtherinfo = {};//当前所有病床的其他信息
		var chartObj = {};//当前chart表对象
		var nowDelBed = {};//当前要删除的病房
		var nowAddPersonBed = {};//当前要添加病人的病床
		var nowStopBed = {};//当前要停止监控的病床
		var nowaddBed = {};//当前要添加的病床
		var startHour = 2;//折线图从几时开始
		var outpatientid = "";//当前要出院的病人
		var currentBedId = "";//鼠标悬停后存储当前床位id
		var currentBedName = "";//鼠标悬停后存储当前床位名称
		var autorefresh;
		var autorefresh4Unnormal;
		var autorefresh4Patient;
		var autorefresh4Concentrator;
		var nowDelPatientId = 0;//当前要删除的病人的id
		var nowDelBedNameOfPatient = "";//当前要删除的病人的床位号
		var sureDelPatient;//询问用户是否删除病人的确认结果
		var nowPageType = 0;//现在页面类型 0：床位列表 1：档案管理
		function getClientHeight() {
			return document.body.scrollHeight > document.documentElement.scrollHeight ? document.body.scrollHeight
					: document.documentElement.scrollHeight;
		}
		function getClientWidth() {
			return document.body.scrollWidth > document.documentElement.scrollWidth ? document.body.scrollWidth
					: document.documentElement.scrollWidth;
		}

		//去后台请求所有病床信息数据
		function getBedsData() {
			$.ajax({
				type : "post",
				url : "listAll.action",
				dataType : "json",
				data : {},
				success : function(data) {
					$(".totalcount").html(data.total);
					bedsinfo = data.data;
					bedsOtherinfo = data.otherdata;
					putBedsData(bedsinfo);
				},
				error : function() {
					$(".totalcount").html(0);
					bedsinfo = [];
					bedsOtherinfo = [];
					putBedsData(bedsinfo);
				}
			})
		}

		//获取温度异常的床位信息
		function getBedsDataOfUnnormal() {
			$.ajax({
				type : "post",
				url : "listAll.action",//"bed/listAll.action",//"tiwen/bedinfo.json",
				dataType : "json",
				data : {},
				success : function(data) {
					$(".totalcount").html(data.total);
					bedsinfo = data.data;
					bedsOtherinfo = data.otherdata;
					putBedsDataOfUnnormal(bedsinfo);

				},
				error : function() {
					$(".totalcount").html(0);
					bedsinfo = [];
					bedsOtherinfo = [];
					putBedsDataOfUnnormal(bedsinfo);
				}
			})
		}
		//删除病床
		function delBed(ele) {
			nowDelBed = $(ele).parents(".bedLi");
			var bedid = $(nowDelBed).attr("id");
			var index = layer.open({
				type : 2,
				area : [ '360px', '240px' ],
				fix : true, //不固定
				maxmin : false,
				content : [ '../static/layerHtml/delBedConfirm.html', 'no' ],
				scrollbar : false,
				closeBtn : 0,
				title : false,
				shade : [ 0.5, '#000000' ]
			//0.1透明度的白色背景
			});
			layer.style(index, {
				'border-radius' : '4px'
			});
		}
		function stopWarning(strmac) {
			$.ajax({
				type : "post",
				url : "stopwarning.action",
				dataType : "json",
				data : {
					"strmac" : strmac
				},
				success : function(data) {

				},
				error : function() {

				}
			})
		}
		function stopWarning4nosign(strmac) {
			$.ajax({
				type : "post",
				url : "stopwarning4nosign.action",
				dataType : "json",
				data : {
					"strmac" : strmac
				},
				success : function(data) {

				},
				error : function() {

				}
			})
		}
		function stopWarning4full(strmac) {
			$.ajax({
				type : "post",
				url : "stopwarning4full.action",
				dataType : "json",
				data : {
					"strmac" : strmac
				},
				success : function(data) {

				},
				error : function() {

				}
			})
		}
		function stopWarning4nopower(strmac) {
			$.ajax({
				type : "post",
				url : "stopwarning4nopower.action",
				dataType : "json",
				data : {
					"strmac" : strmac
				},
				success : function(data) {

				},
				error : function() {

				}
			})
		}
		var ifwarning = false;//是否有其他设备正在报警
		var soundpath = null;
		var indexalert;
		//放入病床信息数据
		function putBedsData(data) {
			var highcount = 0;//高温病人数量
			var lowcount = 0;//低温病人数量
			var emptycount = 0;//空床数量
			var notemptycount = 0;//非空床数量
			$("#bedList").empty();
			$(data)
					.each(
							function(index, dom) {
								//alert(dom.bedstate);
								if (dom.bedstate == "empty") {
									emptycount++;
									$("#bedList")
											.append(
													'<li class="bedLi" bedName="'+dom.bedid+'" id="'+dom.idofbed+'" patientid=""><div class="addPatient4bed" onclick="addPatient(this)" bedName="'
															+ dom.bedid
															+ '" id="'
															+ dom.bedid
															+ '"><span class="addPatientSpan">'
															+ '患者入住</span></div><div class="divbed_bedNum"><div class="div4BedNum"><span class="span4BedNum">'
															+ '床位号：</span><span class="span4BedNum">'
															+ dom.bedid
															+ '</span></div><div><div class="smallbtnDelInEmptyBed4div">'
															+ '<span class="span4Del" onclick="delBed(this);">删除</span></div></div></div></li>');
								} else {
									notemptycount++;
									//alert(dom.state);
									var tempTypeText = "";
									var strbedclassname = "";

									if (dom.state == "superhigh") {
										tempTypeText = "高温";
										highcount++;
										strbedclassname = "superhigh4bed";
										strbedlistname = "#bedList4high";
										soundpath = "../static/sound/super.wav";
										document.getElementById("snd").volume = 0.5;
									} else if (dom.state == "high") {
										tempTypeText = "高温";
										highcount++;
										strbedclassname = "high4bed";
										soundpath = "../static/sound/normal.wav";
										document.getElementById("snd").volume = 1.0;
									} else if (dom.state == "low") {
										tempTypeText = "低温";
										lowcount++;
										strbedclassname = "low4bed";
										soundpath = "../static/sound/normal.wav";
										document.getElementById("snd").volume = 1.0;
									} else {
										tempTypeText = "正常";
										dom.state = "normal";
										strbedclassname = "normal4bed";
										soundpath = "";
									}
									//
									//setTimeout("$(\"#snd\").attr('src',soundpath);layer.alert('"+dom.bedid+"床患者体温异常!',function(){})",5000);
									if (dom.ifWarn && dom.warningType != "0"
											&& !ifwarning) {
										ifwarning = true;
										$("#snd").attr('src', soundpath);
										setTimeout(
												"indexalert=layer.alert('"
														+ dom.bedid
														+ "床患者尿量异常!',{closeBtn: 0},function(){$(\"#snd\").attr('src','');ifwarning=false;stopWarning('"
														+ dom.num
														+ "');layer.close(indexalert);})",
												500);//stopWarning('"+dom.bedid+"');layer.close(indexalert);

									}
									//获取贴片的工作状态，如出现故障则在病床号后边加叹号作为标志
									var statusOfDevice = "";
									if (dom.deviceStatus == 0) {
										statusOfDevice = "(!)";
										if (dom.warningOrNot4NoSign
												&& !ifwarning) {
											ifwarning = true;
											document.getElementById("snd").volume = 1;
											$("#snd")
													.attr('src',
															'../static/sound/normal.wav');
											setTimeout(
													"indexalert=layer.alert('"
															+ dom.bedid
															+ "床设备断开连接已持续十分钟以上，请检查设备!',{closeBtn: 0},function(){$(\"#snd\").attr('src','');ifwarning=false;stopWarning4nosign('"
															+ dom.num
															+ "');layer.close(indexalert);})",
													500);
										}
									}
									if (dom.warningOrNot4Full && !ifwarning) {
										ifwarning = true;
										document.getElementById("snd").volume = 1;
										$("#snd").attr('src',
												'../static/sound/normal.wav');
										setTimeout(
												"indexalert=layer.alert('"
														+ dom.bedid
														+ "床尿袋快满了，请及时更换!',{closeBtn: 0},function(){$(\"#snd\").attr('src','');ifwarning=false;stopWarning4full('"
														+ dom.num
														+ "');layer.close(indexalert);})",
												500);
									}
									bedsBasicinfo[dom.bedid] = dom;
									/* var nowdegree=(dom.degree==undefined||dom.degree<34)?'34.00':dom.degree;
									//判断超低温或者超高温
									var flag4Unnormal='';
									if(dom.degree!=undefined){
										if(dom.degree<34){
											flag4Unnormal='LL';
										}else if(dom.degree>42){
											flag4Unnormal='HH';
										}
									} */
									var strpersonalinfo = dom.personinfo;
									//var seximgurl=(strpersonalinfo.indexOf("-女-")>0)?"../images/woman.ico":"../images/man.ico";
									var sexstr = (strpersonalinfo
											.indexOf("-女-") > 0) ? "女" : "男";
									var strHTML = '<li class="bedLi" id="'+dom.idofbed+'" bedid="'+dom.bedid+'" roomtime="'+dom.roomtime+'" patientid="'+dom.patientid+'">'
									//获取贴片的电量
									var powerNum = dom.powerNum;
									if (powerNum != undefined
											&& powerNum<=10&&powerNum>0
											|| dom.nopower == "1" && !ifwarning) {
										//setTimeout("alert('"+dom.bedid+"床电量不足，剩余电量为："+powerNum+"%')",500);
										strHTML += '<img width="32px" style="float:right;margin-right:10px;margin-top:0px;" height="32px" src="../images/battery_low_32px.png">';
									}
									if (dom.nopower == "1" && !ifwarning) {
										ifwarning = true;
										$("#snd").attr('src',
												'../static/sound/normal.wav');
										setTimeout(
												"indexalert=layer.alert('"
														+ dom.bedid
														+ "床设备电量不足，请及时更换!',{closeBtn: 0},function(){$(\"#snd\").attr('src','');ifwarning=false;stopWarning4nopower('"
														+ dom.num
														+ "');layer.close(indexalert);})",
												500);
									}
									var nowurinebag = ((dom.NY == undefined) ? '0'
											: dom.NY)
											+ 'mL';
									strHTML += '<div class="'+strbedclassname+'"><span class="curNYSpan" >'
											+ nowurinebag
											+ '<font size="1px"></font></span><br><span class="curNLSpan" >'
											+ ((dom.NL == undefined) ? '0'
													: dom.NL)
											+ '<font size="1px">mL/h</font></span>'
											+ '<span class="patientNameSpan">'
											+ dom.name
											+ '</span><br><span class="patientAgeSpan">'
											+ sexstr
											+ ' '
											+ dom.age
											+ '</span></div>';
									strHTML += '<div class="divbed_bedNum"><div class="div4BedNum"><span class="span4BedNum">床位号：</span><span class="span4BedNum">'
											+ dom.bedid
											+ statusOfDevice
											+ '</span>'
											+ '</div><div><div class="smallbtnRecInBedList4div" onclick="showChart(this)"><span class="span4Rec">记录</span></div><div class="smallbtnDelInBedList4div">'
											+ '<span class="span4Del" onclick="delBed(this);">删除</span></div></div></div></li>'
									$("#bedList").append(strHTML);

								}

							})
			$("#bedList")
					.append(
							'<li class="bedLi addbedbtn" onclick="addBed()"><div class="addBed4bed"></div><div class="divbed_bedNum" style="position:relative;">'
									+ '<div id="addBedInList4div" class="addBedInBedsList"><center><span id="addBedInLists4pan">添加床位</span></center>'
									+ '</div></div></li>');
			$(".highcount").html(highcount);
			$(".lowcount").html(lowcount);
			$(".emptycount").html(emptycount);
			$(".notemptycount").html(notemptycount);
			$(".highandlowcount").html(highcount + lowcount);
		}
		//获取异常体温床位数据并显示
		function putBedsDataOfUnnormal(data) {
			var highcount = 0;//高温病人数量
			var lowcount = 0;//低温病人数量
			var emptycount = 0;//空床数量
			var notemptycount = 0;//非空床数量
			$("#bedList4high").empty();
			$("#bedList4low").empty();
			$(data)
					.each(
							function(index, dom) {
								//alert(dom.bedstate);
								if (dom.bedstate == "empty") {
									emptycount++;
								} else {
									notemptycount++;
									//alert(dom.state);
									var tempTypeText = "";
									var strbedclassname = "";
									var strbedlistname = "";

									if (dom.state == "superhigh") {
										tempTypeText = "高温";
										highcount++;
										strbedclassname = "superhigh4bed";
										strbedlistname = "#bedList4high";
										soundpath = "../static/sound/super.wav";
										document.getElementById("snd").volume = 0.5;
									} else if (dom.state == "high") {
										tempTypeText = "高温";
										highcount++;
										strbedclassname = "high4bed";
										strbedlistname = "#bedList4high";
										soundpath = "../static/sound/normal.wav";
										document.getElementById("snd").volume = 1.0;
									} else if (dom.state == "low") {
										tempTypeText = "低温";
										lowcount++;
										strbedclassname = "low4bed";
										strbedlistname = "#bedList4low";
										soundpath = "../static/sound/normal.wav";
										document.getElementById("snd").volume = 1.0;
									} else {
										tempTypeText = "正常";
										dom.state = "normal";
										strbedclassname = "normal4bed";
										strbedlistname = "#bedList";
										soundpath = "";
									}
									if (dom.ifWarn && dom.warningType != "0"
											&& !ifwarning) {
										ifwarning = true;
										$("#snd").attr('src', soundpath);
										setTimeout(
												"indexalert=layer.alert('"
														+ dom.bedid
														+ "床患者尿量异常!',{closeBtn: 0},function(){$(\"#snd\").attr('src','');ifwarning=false;stopWarning('"
														+ dom.num
														+ "');layer.close(indexalert);})",
												500);//stopWarning('"+dom.bedid+"');layer.close(indexalert);

									}
									//获取贴片的工作状态，如出现故障则在病床号后边加叹号作为标志
									var statusOfDevice = "";
									if (dom.deviceStatus == 0) {
										statusOfDevice = "(!)";
										if (dom.warningOrNot4NoSign
												&& !ifwarning) {
											ifwarning = true;
											document.getElementById("snd").volume = 1;
											$("#snd")
													.attr('src',
															'../static/sound/normal.wav');
											setTimeout(
													"indexalert=layer.alert('"
															+ dom.bedid
															+ "床设备断开连接已持续十分钟以上，请检查设备!',{closeBtn: 0},function(){$(\"#snd\").attr('src','');ifwarning=false;stopWarning4nosign('"
															+ dom.num
															+ "');layer.close(indexalert);})",
													500);
										}
									}
									if (dom.warningOrNot4Full && !ifwarning) {
										ifwarning = true;
										document.getElementById("snd").volume = 1;
										$("#snd").attr('src',
												'../static/sound/normal.wav');
										setTimeout(
												"indexalert=layer.alert('"
														+ dom.bedid
														+ "床尿袋快满了，请及时更换!',{closeBtn: 0},function(){$(\"#snd\").attr('src','');ifwarning=false;stopWarning4full('"
														+ dom.num
														+ "');layer.close(indexalert);})",
												500);
									}

									//alert(dom.deviceStatus);
									//alert(dom.degree+"sss");
									//alert(dom.patientid);
									bedsBasicinfo[dom.bedid] = dom;
									/* var nowdegree=(dom.degree==undefined||dom.degree<34)?'34.00':dom.degree;
									//判断超低温或者超高温
									var flag4Unnormal='';
									if(dom.degree!=undefined){
										if(dom.degree<=34){
											flag4Unnormal='LL';
										}else if(dom.degree>42){
											flag4Unnormal='HH';
										}
									} */
									var strpersonalinfo = dom.personinfo;
									//var seximgurl=(strpersonalinfo.indexOf("-女-")>0)?"../images/woman.ico":"../images/man.ico";
									var sexstr = (strpersonalinfo
											.indexOf("-女-") > 0) ? "女" : "男";

									var strHTML = '<li class="bedLi" id="'+dom.idofbed+'" bedid="'+dom.bedid+'" roomtime="'+dom.roomtime+'" patientid="'+dom.patientid+'">';
									//获取贴片的电量
									var powerNum = dom.powerNum;
									if (powerNum != undefined
											&& powerNum<=10&&powerNum>0
											|| dom.nopower == "1" && !ifwarning) {
										//setTimeout("alert('"+dom.bedid+"床电量不足，剩余电量为："+powerNum+"%')",500);
										strHTML += '<img width="32px" style="float:right;margin-right:10px;margin-top:0px;" height="32px" src="../images/battery_low_32px.png">';
									}
									if (dom.nopower == "1" && !ifwarning) {
										ifwarning = true;
										$("#snd").attr('src',
												'../static/sound/normal.wav');
										setTimeout(
												"indexalert=layer.alert('"
														+ dom.bedid
														+ "床设备电量不足，请及时更换!',{closeBtn: 0},function(){$(\"#snd\").attr('src','');ifwarning=false;stopWarning4nopower('"
														+ dom.num
														+ "');layer.close(indexalert);})",
												500);
									}
									var nowurinebag = ((dom.NY == undefined) ? '0'
											: dom.NY)
											+ 'mL';
									strHTML += '<div class="'+strbedclassname+'"><span class="curNYSpan" >'
											+ nowurinebag
											+ '<font size="1px"></font></span><br><span class="curNLSpan" >'
											+ ((dom.NL == undefined) ? '0'
													: dom.NL)
											+ '<font size="1px">mL/h</font></span>'
											+ '<span class="patientNameSpan">'
											+ dom.name
											+ '</span><br><span class="patientAgeSpan">'
											+ sexstr
											+ ' '
											+ dom.age
											+ '</span></div>';
									strHTML += '<div class="divbed_bedNum"><div class="div4BedNum"><span class="span4BedNum">床位号：</span><span class="span4BedNum">'
											+ dom.bedid
											+ statusOfDevice
											+ '</span>'
											+ '</div><div><div class="smallbtnRecInBedList4div" onclick="showChart(this)"><span class="span4Rec">记录</span></div><div class="smallbtnDelInBedList4div">'
											+ '<span class="span4Del" onclick="delBed(this);">删除</span></div></div></div></li>'
									$("#bedList").append(strHTML);
									if (strbedlistname != "#bedList")
										$(strbedlistname).append(strHTML);
									/* //获取贴片的电量
									var powerNum=dom.powerNum;
									if(powerNum!=undefined&&powerNum<=10){
										//setTimeout("alert('"+dom.bedid+"床电量不足，剩余电量为："+powerNum+"%')",500);
									} */
								}

							})
			$(".highcount").html(highcount);
			$(".lowcount").html(lowcount);
			$(".emptycount").html(emptycount);
			$(".notemptycount").html(notemptycount);
			$(".highandlowcount").html(highcount + lowcount);
		}

		//添加床位
		function addBed(ele) {
			nowaddBed = ele;
			$('.modelbg').show();
			$(".concentratorNo").val("");
			$(".putbedidbox").show();
		}
		//添加病床
		function addbed() {
			/* 			alert(nowaddBed);
			 alert($(obj).prop("className"));return; */
			if ($(".addbedid").val().trim().length == 0) {
				layer.alert("请检查病床ID是否填写正确");
				return;
			}
			if ($(".concentratorNo").val().length != 0
					&& $(".concentratorNo").val().length != 12) {
				layer.alert("请检查集中器ID是否填写正确");
				return;
			}
			$
					.ajax({
						type : "post",
						url : "add.action",//"tiwen/addbed.json",
						dataType : "json",
						data : {
							"bedid" : $(".addbedid").val().trim(),
							"concentratorNo" : $(".concentratorNo").val()
						},
						success : function(data) {
							if (data.success == false) {
								layer.alert("添加失败，请确认要添加的病床号没有重复！");
								return;
							}
							getBedsData();
							$('.putbedidbox').hide();
							return;
							$(".addbedbtn")
									.before(
											'<li class="bedLi" bedName="'+data.bedid+'" id="'+data.idofbed+'" patientid=""><div class="addPatient4bed" onclick="addPatient(this)" bedName="'
													+ data.bedid
													+ '" id="'
													+ data.bedid
													+ '"><span class="addPatientSpan">'
													+ '患者入住</span></div><div class="divbed_bedNum"><div class="div4BedNum"><span class="span4BedNum">'
													+ '床位号：</span><span class="span4BedNum">'
													+ data.bedid
													+ '</span></div><div><div class="smallbtnDelInEmptyBed4div">'
													+ '<span class="span4Del" onclick="delBed(this);">删除</span></div></div></div></li>');
							/* 					listenAddBed();
							 listenAddPerson();
							 listenBedHover();
							 listenListenBt();
							 listenCloseTishi();
							 listenShowPrint();
							 listenDelBed(); */
						},
						error : function(data) {
							layer.alert("添加失败");
						}
					})
		}
		//添加病人（温度监控界面）
		function addPatient(ele) {
			$("#titie4AddOrUpdatePatient").text("添加患者");
			var IsChrome = navigator.userAgent.toLowerCase().match(/chrome/);
			if (IsChrome == "chrome"
					&& navigator.userAgent.toLowerCase().match(/edge/) != "edge") {
				$(".addpersonbox table tr").css("height", "24px");
			} else {
				$(".addpersonbox table tr").css("height", "32px");
			}
			openAddPerson();
			nowAddPersonBed = $(ele).parents(".bedLi");
			//console.dir(nowAddPersonBed);
			$("#bedid").val(ele.getAttribute("bedName"));

		}
		//添加病人（档案管理页面）
		function addPatient4btn() {
			$("#titie4AddOrUpdatePatient").text("添加患者");
			var IsChrome = navigator.userAgent.toLowerCase().match(/chrome/);
			if (IsChrome == "chrome"
					&& navigator.userAgent.toLowerCase().match(/edge/) != "edge") {
				$(".addpersonbox table tr").css("height", "24px");
			} else {
				$(".addpersonbox table tr").css("height", "32px");
			}
			openAddPerson();
		}
		//添加病人窗口点击取消
		function cancelAddPatient() {
			$('.addpersonbox').hide();
			$('.modelbg').hide();
		}
		function updatePatient(ele) {
			var IsChrome = navigator.userAgent.toLowerCase().match(/chrome/);
			if (IsChrome == "chrome"
					&& navigator.userAgent.toLowerCase().match(/edge/) != "edge") {
				$(".addpersonbox table tr").css("height", "24px");
			} else {
				$(".addpersonbox table tr").css("height", "32px");
			}
			$('.modelbg').show();
			nowDelPatientId = $(ele).attr("personnelId");
			$("#titie4AddOrUpdatePatient").text("修改患者信息");
			$.ajax({
				type : "post",
				url : "../patient/getPatientById.action",//添加病人信息
				dataType : "json",
				data : {
					id : nowDelPatientId
				},
				success : function(data) {
					$("#patientid").val(data.id);
					$(".addpersonbox").find("input[name=name]").val(data.name);//病人姓名
					$(".addpersonbox").find(
							"input[name=sex][value=" + data.sex + "]").click();//性别
					$(".addpersonbox").find("input[name=age]").val(data.age);//年龄
					$(".addpersonbox").find("input[name=roomtime]").val(
							data.roomtime);//入院时间
					$(".addpersonbox").find("input[name=sicknum]").val(
							data.sickid);//病案号码
					$(".addpersonbox").find("input[name=sickname]").val(
							data.sickname);//所患疾病
					$(".addpersonbox").find("input[name=doctor]").val(
							data.doctor);//主管医生
					$(".addpersonbox").find("input[name=roomid]").val(
							data.roomid);//病房号
					$(".addpersonbox").find("input[name=bedid]")
							.val(data.bedid);//病床号
					$("#idofbed").val(data.idofbed);//病床id
					$(".addpersonbox").find("input[name=cardname]").val(
							data.cardname);//贴片号码
					/* $(".addpersonbox").find("input[name=highc]").val(
							data.highc);//温度监控范围 最低温度
					$(".addpersonbox").find("input[name=lowc]").val(
							data.lowc);//温度监控范围 最高温度 */
					$(".addpersonbox").find("input[name=highNY]").val(
							data.highNY);//温度监控范围 最低温度
					$(".addpersonbox").find("input[name=lowNY]")
							.val(data.lowNY);
					$(".addpersonbox").find("input[name=samplingTime]").val(
							data.samplingTime);
					/* $(".addpersonbox").find("input[name=superHighDegree]").val(
									data.superHighDegree);//温度监控范围 最高温度 */
					/* $(".addpersonbox").find("input[name=count]").val(
							data.count);//温度采集间隔数字 */
					$(".addpersonbox").find("input[name=sicktype]").val(
							data.sicktype);//就医类型
					$(".addpersonbox").find("input[name=personid]").val(
							data.personid);//身份证
					$(".addpersonbox").find("input[name=address]").val(
							data.address);//地址
					$(".addpersonbox").show();
				}
			})
		}
		function delPatient(ele) {
			nowDelPatientId = $(ele).attr("personnelId");
			nowDelBedNameOfPatient = $(ele).attr("bedName");
			var index = layer
					.open({
						type : 2,
						area : [ '360px', '240px' ],
						fix : true, //不固定
						maxmin : false,
						content : [
								'../static/layerHtml/delPatientConfirm.html',
								'no' ],
						scrollbar : false,
						closeBtn : 0,
						title : false,
						shade : [ 0.5, '#000000' ]
					//0.1透明度的白色背景
					});
			layer.style(index, {
				'border-radius' : '4px'
			});

		}
		function sureDelPatient() {
			$.ajax({
				type : "post",
				url : "../patient/delete.action",//此处返回true或false
				dataType : "json",
				data : {
					id : nowDelPatientId,
					bedname : nowDelBedNameOfPatient
				},
				success : function(data) {
					$(".modelbg").hide();
					$(".confirmbox").hide();
					//location.reload(true);
					getPatientListData();
				}
			})
		}

		//rxz 病人出院
		function patientOut() {
			$(".bedmoreinfo").hide();
			var index = layer
					.open({
						type : 2,
						area : [ '360px', '240px' ],
						fix : true, //不固定
						maxmin : false,
						content : [
								'../static/layerHtml/patientOutConfirm.html',
								'no' ],
						scrollbar : false,
						closeBtn : 0,
						title : false,
						shade : [ 0.5, '#000000' ]
					//0.1透明度的白色背景
					});
			layer.style(index, {
				'border-radius' : '4px'
			});
		}

		function surePatientOut() {
			$.ajax({
				type : "post",
				url : "../patient/patientout.action",//��Ӳ�����Ϣ
				dataType : "json",
				data : {
					"id" : outpatientid
				},
				success : function(data) {
					if (data.success == false) {
						//alert(data.bedstatus);
						layer.alert("操作失败！");
						return;
					}
					getBedsData();
				}

			})
		}
		//转科室
		function changeDepartment() {
			$(".bedmoreinfo").hide();
			//初始化部门列表
			$.ajax({
				type : "post",
				url : "listDepartments.action",//��Ӳ�����Ϣ
				dataType : "json",
				data : {},
				success : function(data) {
					if (data.success == false) {
						//alert(data.bedstatus);
						alert("操作失败！");
						return;
					}
					$("#selDepartment").empty();
					for (var i = 0; i < data.length; i++) {
						$("#selDepartment").append(
								"<option value='"+data[i].id+"'>"
										+ data[i].name + "</option>"); //为Select追加一个Option(下拉项) 
					}
					if (data.length > 0) {
						InitBedsByDepartment();
					}
				}

			})
			var h = $(window).height();
			var w = $(window).width();
			var st = $(window).scrollTop();
			var sl = $(window).scrollLeft();
			$(".changeBedDialog").css({
				"left" : ((w - 250) / 2) + sl + "px",
				"top" : ((h - 125) / 2) + st + "px"
			}).show();
		}
		function InitBedsByDepartment() {
			var departmentId = $("#selDepartment").val();
			//jQuery("#select1  option:selected").text();
			$.ajax({
				type : "post",
				url : "getBedsByDepartmentId.action",//��Ӳ�����Ϣ
				dataType : "json",
				data : {
					"departmentId" : departmentId
				},
				success : function(data) {
					if (data.success == false) {
						//alert(data.bedstatus);
						alert("操作失败！");
						return;
					}
					$("#selBed").empty();
					for (var i = 0; i < data.length; i++) {
						$("#selBed").append(
								"<option value='"+data[i].id+"'>"
										+ data[i].name + "</option>"); //为Select追加一个Option(下拉项) 
					}
				}

			})
		}
		//确认转科室
		function sureChangeDepartment() {
			/* alert(outpatientid);
			alert(currentBedName);
			alert(currentBedId); */
			$.ajax({
				type : "post",
				url : "../patient/changeBed.action",//��Ӳ�����Ϣ
				dataType : "json",
				data : {
					"patientid" : outpatientid,
					"oldbedid" : currentBedId,
					"newbedid" : $("#selBed").val()
				},
				success : function(data) {
					if (data.success == false) {
						//alert(data.bedstatus);
						alert("操作失败！");
						return;
					}
					location.reload(true);
				}

			})
		}
		//显示体温表打印页面
		function showPrint() {
			var id = outpatientid;//$(this).attr('patientid');20160122
			window.open('../show/export.action?id=' + id);
		}

		//点击病人名称显示折线图界面
		function showDegree(ele) {
			var tempTimer;
			//var curbed = $(ele).parents(".bedLi");
			currentBedName = $(ele).attr("bedid");
			var nowaboutinfo = bedsOtherinfo[currentBedName];
			var nowaboutinfoBed = bedsBasicinfo[currentBedName];
			console.dir(nowaboutinfoBed);
			currentBedId = nowaboutinfoBed.idofbed;//将当前床位id存到全局变量中
			curMac4Chart = nowaboutinfoBed.num;
			//alert(nowaboutinfo.personid);
			//给chat赋值
			var contentInfo = "<table style='width:100%;font-size:14px;color:#666666;margin-top:14px;border-collapse:separate;border-spacing:10px;'>";
			contentInfo += "<tr><td>病人信息：" + nowaboutinfoBed.personinfo
					+ "</td><td>贴片号码：" + nowaboutinfoBed.num + "</td><td>病案号码："
					+ nowaboutinfoBed.sicknum + "</td>";
			contentInfo += "<tr><td>入院时间：" + nowaboutinfoBed.roomtime
					+ "</td><td>监控时间：" + nowaboutinfoBed.listentime
					+ "</td><td>剩余时间：约" + nowaboutinfoBed.surplustime
					+ "小时</td>";
			contentInfo += "<tr><td>正常尿量：" + nowaboutinfoBed.range
					+ "mL</td><td>主治医师：" + nowaboutinfoBed.doctor
					+ "</td><td>医师诊断：" + nowaboutinfoBed.diagnosis + "</td>";
			contentInfo = contentInfo + "</table>";
			$(".bedmoreinfo .personid").html(contentInfo);
			outpatientid = bedsBasicinfo[currentBedName].patientid;//$(curbed).attr("patientid");
			var str = bedsBasicinfo[currentBedName].roomtime;//$(curbed).attr("roomtime");
			// 转换日期格式
			str = str.replace(/-/g, '/'); // "2010/08/01";
			//$("#day1").text($(curbed).attr("roomtime"));
			// 创建日期对象
			var date = new Date(str);
			// 加一天
			date.setDate(date.getDate() + 1);//获取AddDayCount天后的日期
			var y = date.getFullYear();
			var m = date.getMonth() + 1;//获取当前月份的日期
			var d = date.getDate();
			$("#day2").text(y + "-" + m + "-" + d);
			//*****************************************************************通过mac地址获取温度数据
			$
					.ajax({
						type : "post",
						url : "getDegreeByMac.action",//��Ӳ�����Ϣ
						dataType : "json",
						data : {
							"strMac" : nowaboutinfoBed.num,
							"type4Time" : $(".select4Time").val()
						},
						success : function(data) {
							console.dir(data);
							curChartData = data;
							//data.degrees4chart=[35.1,36,37,35,36,35.1,36,37,35,36,35.1,36,37,35,36,35.1,36,37,35,36,35.1,36,37,35,36,35.1,36,37,35,36,35.1,36,37,35,36,35.1,36,37,35,36];
							//data.dhs4chart=["06-01 02","06-01 04","06-01 06","06-01 08","06-01 10","06-01 02","06-01 04","06-01 06","06-01 08","06-01 10","06-01 02","06-01 04","06-01 06","06-01 08","06-01 10","06-01 02","06-01 04","06-01 06","06-01 08","06-01 10","06-01 02","06-01 04","06-01 06","06-01 08","06-01 10","06-01 02","06-01 04","06-01 06","06-01 08","06-01 10","06-01 02","06-01 04","06-01 06","06-01 08","06-01 10","06-01 02","06-01 04","06-01 06","06-01 08","06-01 10"];
							//data.times4chart=["02","04","06","08","10","02","04","06","08","10","02","04","06","08","10","02","04","06","08","10","02","04","06","08","10","02","04","06","08","10","02","04","06","08","10","02","04","06","08","10"];
							if (data.times4chart && data.times4chart.length > 0) {
								chartObj.xAxis[0]
										.setCategories(data.times4chart[0]);
								//chartObj.series[0].setData(data.degrees4chart[0]);
								chartObj.series[0].setData(data.nys4chart[0]);
								chartObj.series[1].setData(data.nls4chart[0]);
								chartObj.xAxis[0]
										.update({
											max : data.times4chart[0].length - 1,
											//min:maxNo
											labels : {
												step : data.times4chart[0].length > 24 ? Math
														.ceil(data.times4chart[0].length / 16)
														: 1
											}
										});
								//chartObj.setTitle('444'+data.dates4Chart[0]);
								/* var title = {
									    text:data.dates4Chart[0],
									    style:{
									        color:"#333333"
									    }
									};
								chartObj.setTitle(title); */
							} else {
								layer.alert('没有数据！');
								return;
							}
							maxDateIndex = data.dates4Chart.length;
							curDateIndex = 1;
							$(".PreviousDay").css("display", "none");
							if (data.dates4Chart.length > 1) {
								$(".NextDay").css("display", "block");
							} else {
								$(".NextDay").css("display", "none");
							}
							/* if(data.times4chart.length<21&&data.times4chart.length>1){
								//chartObj.xAxis[0].max(data.PI4chart.length);
								//chartObj.xAxis[0].max=data.PI4chart.length;
								//chartObj.xAxis[0].setExtremes(1,10);
								chartObj.xAxis[0].update({
							        max: data.times4chart.length-1
							    });
							}else if(data.times4chart.length<=1){
								chartObj.xAxis[0].update({
							        max: 1
							    });
							}else{
								chartObj.xAxis[0].update({
							        max: 20
							    });
							} */
							var strDHS = data.dhs4chart;
							//var strHtml4Table='<thead style="position:absolute;top:58px"><td style="border:0px;font-size:16px;width:99px">时间</td><td style="border:0px;font-size:16px;width:101px">温度</td></thead>';
							var strHtml4Table = '<thead style="position:absolute;top:58px"><td style="border:0px;font-size:16px;width:99px">时间</td>'
									+ '<td style="border:0px;font-size:16px;width:50px">尿量</td>'
									+ '<td style="border:0px;font-size:16px;width:100px">尿流率</td>'
									+ '</thead>';
							var classname4td = "";
							var nysResult;
							var nlsResult;
							for (var i = 0; i < data.nys4chart.length; i++) {
								if (i == 0) {
									//degreesResult=data.degrees4chart[i];
									nysResult = data.nys4chart[i];
									nlsResult = data.nls4chart[i];
								} else {
									//degreesResult=degreesResult.concat(data.degrees4chart[i]); 
									nysResult = nysResult
											.concat(data.nys4chart[i]);
									nlsResult = nlsResult
											.concat(data.nls4chart[i]);
								}
							}

							if (strDHS != null)
								for (var i = 0; i < strDHS.length; i++) {
									if (i % 2 == 0) {
										classname4td = "tdOdd";
									} else {
										classname4td = "tdEven";
									}
									strHtml4Table = strHtml4Table
											+ '<tr class="'+classname4td+'"><td align="right">'
											+ strDHS[i] + '</td><td>'
											+ nysResult[i] + '</td><td>'
											+ nlsResult[i] + '</td></tr>';
								}
							$(".ttTable").html(strHtml4Table);
							//chartObj.series[0].setData([35.1,36,37,35,36,37,39,38,36,37,39,37,37,35,36,37,37,37,37,35  ,35,36,37,35,36,37,39,38,36,37,39,37,37,35,36,37,37,37,37,35,37,37,37,35,37,37,37,35]);
							//chartObj.xAxis[0].setCategories(["15:10","","","","15:10","","","","15:10","","","","15:10","","","","15:10","","","","15:10","","","","15:10","","","","15:10","","","","15:10","","","","15:10","","","","15:10","","","","15:10","","15:10",""]);
							$("#day1").css("display", "none");
							$("#day2").css("display", "none");
							if (tempTimer) {
								clearTimeout(tempTimer);
							}
							tempTimer = setTimeout(function() {
								$('.modelbg').show();
								$(".bedmoreinfo").css({
									"left" : getClientWidth() / 2 - 470 + "px",
									"top" : getClientHeight() / 2 - 335 + "px"
								}).show();//.show()
								if (data.times4chart) {
									var title = {
										text : data.dates4Chart[0],
										style : {
											color : "#333333"
										}
									};
									chartObj.setTitle(title);
								}
							}, 500)
						}

					})
		}
		//将传入数据转换为字符串,并清除字符串中非数字与.的字符  
		//按数字格式补全字符串  
		var getFloatStr = function(num) {
			num += '';
			num = num.replace(/[^0-9|\.]/g, ''); //清除字符串中的非数字非.字符  

			if (/^0+/) //清除字符串开头的0  
				num = num.replace(/^0+/, '');
			if (!/\./.test(num)) //为整数字符串在末尾添加.00  
				num += '.00';
			if (/^\./.test(num)) //字符以.开头时,在开头添加0  
				num = '0' + num;
			num += '00'; //在字符串末尾补零  
			num = num.match(/\d+\.\d{2}/)[0];
			return num;
		};
		function ChangeTime() {
			$
					.ajax({
						type : "post",
						url : "getDegreeByMac.action",//��Ӳ�����Ϣ
						dataType : "json",
						data : {
							"strMac" : curMac4Chart,
							"type4Time" : $(".select4Time").val()
						},
						success : function(data) {
							curChartData = data;
							if (data.times4chart) {
								chartObj.xAxis[0]
										.setCategories(data.times4chart[0]);
								//chartObj.series[0].setData(data.degrees4chart[0]);
								chartObj.series[0].setData(data.nys4chart[0]);
								chartObj.series[1].setData(data.nls4chart[0]);
								chartObj.xAxis[0]
										.update({
											max : data.times4chart[0].length - 1,
											//min:maxNo
											labels : {
												step : data.times4chart[0].length > 24 ? Math
														.ceil(data.times4chart[0].length / 16)
														: 1
											}
										});
								//chartObj.setTitle('444'+data.dates4Chart[0]);
								var title = {
									text : data.dates4Chart[0],
									style : {
										color : "#333333"
									}
								};
								chartObj.setTitle(title);
							} else {
								layer.alert('没有数据！');
								return;
							}
							maxDateIndex = data.dates4Chart.length;
							curDateIndex = 1;
							$(".PreviousDay").css("display", "none");
							if (data.dates4Chart.length > 1) {
								$(".NextDay").css("display", "block");
							} else {
								$(".NextDay").css("display", "none");
							}
							/* if(data.times4chart.length<21&&data.times4chart.length>1){
								//chartObj.xAxis[0].max(data.PI4chart.length);
								//chartObj.xAxis[0].max=data.PI4chart.length;
								//chartObj.xAxis[0].setExtremes(1,10);
								var maxNo=data.times4chart.length-1;
								chartObj.xAxis[0].update({
							        max: maxNo,
							        //min:maxNo
							    });//alert(maxNo);
							}else if(data.times4chart.length<=1){
								chartObj.xAxis[0].update({
							        max: 0,
							        //min:0
							    });
							}else{
								chartObj.xAxis[0].update({
							        max: 20,
							        //min:20
							    });
							} */
							var strDHS = data.dhs4chart;
							//var strHtml4Table='<thead style="position:absolute;top:58px"><td style="border:0px;font-size:16px;width:99px">时间</td><td style="border:0px;font-size:16px;width:101px">温度</td></thead>';
							var strHtml4Table = '<thead style="position:absolute;top:58px"><td style="border:0px;font-size:16px;width:99px">时间</td>'
									+ '<td style="border:0px;font-size:16px;width:50px">尿量</td>'
									+ '<td style="border:0px;font-size:16px;width:100px">尿流率</td>'
									+ '</thead>';
							var classname4td = "";
							var nysResult;
							var nlsResult;
							for (var i = 0; i < data.nys4chart.length; i++) {
								if (i == 0) {
									//degreesResult=data.degrees4chart[i];
									nysResult = data.nys4chart[i];
									nlsResult = data.nls4chart[i];
								} else {
									//degreesResult=degreesResult.concat(data.degrees4chart[i]); 
									nysResult = nysResult
											.concat(data.nys4chart[i]);
									nlsResult = nlsResult
											.concat(data.nls4chart[i]);
								}
							}

							if (strDHS != null)
								for (var i = 0; i < strDHS.length; i++) {
									if (i % 2 == 0) {
										classname4td = "tdOdd";
									} else {
										classname4td = "tdEven";
									}
									strHtml4Table = strHtml4Table
											+ '<tr class="'+classname4td+'"><td align="right">'
											+ strDHS[i] + '</td><td>'
											+ nysResult[i] + '</td><td>'
											+ nlsResult[i] + '</td></tr>';
								}
							$(".ttTable").html(strHtml4Table);
						}

					})
		}
		function PreviousDay() {
			curDateIndex--;
			if (curDateIndex == 1) {
				$(".PreviousDay").css("display", "none");
			}
			if (curDateIndex < maxDateIndex) {
				$(".NextDay").css("display", "block");
			}
			chartObj.xAxis[0]
					.update({
						max : curChartData.times4chart[curDateIndex - 1].length - 1,
						labels : {
							step : curChartData.times4chart[curDateIndex - 1].length > 24 ? Math
									.ceil(curChartData.times4chart[curDateIndex - 1].length / 16)
									: 1
						}
					});
			var title = {
				text : curChartData.dates4Chart[curDateIndex - 1],
				style : {
					color : "#333333"
				}
			};
			chartObj.setTitle(title, null, false);
			chartObj.xAxis[0]
					.setCategories(curChartData.times4chart[curDateIndex - 1]);
			chartObj.series[0]
					.setData(curChartData.degrees4chart[curDateIndex - 1]);
		}
		function NextDay() {
			curDateIndex++;
			if (curDateIndex == maxDateIndex) {
				$(".NextDay").css("display", "none");
			}
			if (curDateIndex > 1) {
				$(".PreviousDay").css("display", "block");
			}
			chartObj.xAxis[0]
					.update({
						max : curChartData.times4chart[curDateIndex - 1].length - 1,
						labels : {
							step : curChartData.times4chart[curDateIndex - 1].length > 24 ? Math
									.ceil(curChartData.times4chart[curDateIndex - 1].length / 16)
									: 1
						}
					});
			var title = {
				text : curChartData.dates4Chart[curDateIndex - 1],
				style : {
					color : "#333333"
				}
			};
			chartObj.setTitle(title, null, false);
			chartObj.xAxis[0]
					.setCategories(curChartData.times4chart[curDateIndex - 1]);
			chartObj.series[0]
					.setData(curChartData.degrees4chart[curDateIndex - 1]);
		}
		var curMac4Chart;
		var curChartData;//当前病人的折线图相关数据，从getDegreeByMac请求获得
		var curDateIndex;//折线图当前的日期序号，即第几天
		var maxDateIndex;//当前折线图总共的天数
		//点击记录显示折线图
		function showChart(ele) {
			var tempTimer;
			var curbed = $(ele).parents(".bedLi");
			currentBedName = $(curbed).attr("bedid");
			var nowaboutinfo = bedsOtherinfo[currentBedName];
			var nowaboutinfoBed = bedsBasicinfo[currentBedName];
			console.dir(bedsBasicinfo);
			currentBedId = nowaboutinfoBed.idofbed;//将当前床位id存到全局变量中
			curMac4Chart = nowaboutinfoBed.num;
			//alert(nowaboutinfo.personid);
			//给chat赋值
			var contentInfo = "<table style='width:100%;font-size:14px;color:#666666;margin-top:14px;border-collapse:separate;border-spacing:10px;'>";
			contentInfo += "<tr><td>病人信息：" + nowaboutinfoBed.personinfo
					+ "</td><td>贴片号码：" + nowaboutinfoBed.num + "</td><td>病案号码："
					+ nowaboutinfoBed.sicknum + "</td>";
			contentInfo += "<tr><td>入院时间：" + nowaboutinfoBed.roomtime
					+ "</td><td>监控时间：" + nowaboutinfoBed.listentime
					+ "</td><td>剩余时间：约" + nowaboutinfoBed.surplustime
					+ "小时</td>";
			contentInfo += "<tr><td>正常尿量：" + nowaboutinfoBed.range
					+ "mL</td><td>主治医师：" + nowaboutinfoBed.doctor
					+ "</td><td>医师诊断：" + nowaboutinfoBed.diagnosis + "</td>";
			contentInfo = contentInfo + "</table>";
			$(".bedmoreinfo .personid").html(contentInfo);
			outpatientid = $(curbed).attr("patientid");
			var str = $(curbed).attr("roomtime");
			// 转换日期格式
			str = str.replace(/-/g, '/'); // "2010/08/01";
			$("#day1").text($(curbed).attr("roomtime"));
			// 创建日期对象
			var date = new Date(str);
			// 加一天
			date.setDate(date.getDate() + 1);//获取AddDayCount天后的日期
			var y = date.getFullYear();
			var m = date.getMonth() + 1;//获取当前月份的日期
			var d = date.getDate();
			$("#day2").text(y + "-" + m + "-" + d);
			//*****************************************************************通过mac地址获取温度数据
			$
					.ajax({
						type : "post",
						url : "getDegreeByMac.action",//��Ӳ�����Ϣ
						dataType : "json",
						data : {
							"strMac" : nowaboutinfoBed.num,
							"type4Time" : $(".select4Time").val()
						},
						success : function(data) {
							console.dir(data);
							curChartData = data;
							//alert(chartObj.xAxis[0].max);
							//data.degrees4chart=[35.1,36,37,35,36,35.1,36,37,35,36,35.1,36,37,35,36,35.1,36,37,35,36,35.1,36,37,35,36,35.1,36,37,35,36,35.1,36,37,35,36,35.1,36,37,35,36];
							//data.dhs4chart=["06-01 02","06-01 04","06-01 06","06-01 08","06-01 10","06-01 02","06-01 04","06-01 06","06-01 08","06-01 10","06-01 02","06-01 04","06-01 06","06-01 08","06-01 10","06-01 02","06-01 04","06-01 06","06-01 08","06-01 10","06-01 02","06-01 04","06-01 06","06-01 08","06-01 10","06-01 02","06-01 04","06-01 06","06-01 08","06-01 10","06-01 02","06-01 04","06-01 06","06-01 08","06-01 10","06-01 02","06-01 04","06-01 06","06-01 08","06-01 10"];
							//data.times4chart=["02","04","06","08","10","02","04","06","08","10","02","04","06","08","10","02","04","06","08","10","02","04","06","08","10","02","04","06","08","10","02","04","06","08","10","02","04","06","08","10"];

							if (data.times4chart && data.times4chart.length > 0) {
								chartObj.xAxis[0]
										.setCategories(data.times4chart[0]);
								//chartObj.series[0].setData(data.degrees4chart[0]);
								chartObj.series[0].setData(data.nys4chart[0]);
								chartObj.series[1].setData(data.nls4chart[0]);
								chartObj.xAxis[0]
										.update({
											max : data.times4chart[0].length - 1,
											//min:maxNo
											labels : {
												step : data.times4chart[0].length > 24 ? Math
														.ceil(data.times4chart[0].length / 16)
														: 1
											}
										});
								//chartObj.setTitle('444'+data.dates4Chart[0]);
								/* var title = {
									    text:data.dates4Chart[0],
									    style:{
									        color:"#333333"
									    }
									}; */
								//chartObj.setTitle(title);
							} else {
								layer.alert('没有数据！');
								return;
							}
							maxDateIndex = data.dates4Chart.length;
							curDateIndex = 1;
							$(".PreviousDay").css("display", "none");
							if (data.dates4Chart.length > 1) {
								$(".NextDay").css("display", "block");
							} else {
								$(".NextDay").css("display", "none");
							}

							/* if(data.times4chart.length<21&&data.times4chart.length>1){
								//chartObj.xAxis[0].max(data.PI4chart.length);
								//chartObj.xAxis[0].max=data.PI4chart.length;
								//chartObj.xAxis[0].setExtremes(1,10);
								var maxNo=data.times4chart.length-1;
								chartObj.xAxis[0].update({
							        max: maxNo,
							        //min:maxNo
							    });//alert(maxNo);
							}else if(data.times4chart.length<=1){
								chartObj.xAxis[0].update({
							        max: 0,
							        //min:1
							    });
							}else{
								chartObj.xAxis[0].update({
							        max: 20,
							        //min:20
							    });
							} */
							var strDHS = data.dhs4chart;
							var strHtml4Table = '<thead style="position:absolute;top:58px"><td style="border:0px;font-size:16px;width:99px">时间</td>'
									+ '<td style="border:0px;font-size:16px;width:50px">尿量</td>'
									+ '<td style="border:0px;font-size:16px;width:100px">尿流率</td>'
									+ '</thead>';
							var classname4td = "";
							//var degreesResult;
							var nysResult;
							var nlsResult;
							for (var i = 0; i < data.nys4chart.length; i++) {
								if (i == 0) {
									//degreesResult=data.degrees4chart[i];
									nysResult = data.nys4chart[i];
									nlsResult = data.nls4chart[i];
								} else {
									//degreesResult=degreesResult.concat(data.degrees4chart[i]); 
									nysResult = nysResult
											.concat(data.nys4chart[i]);
									nlsResult = nlsResult
											.concat(data.nls4chart[i]);
								}
							}
							if (strDHS != null)
								for (var i = 0; i < strDHS.length; i++) {
									if (i % 2 == 0) {
										classname4td = "tdOdd";
									} else {
										classname4td = "tdEven";
									}
									strHtml4Table = strHtml4Table
											+ '<tr class="'+classname4td+'"><td align="right">'
											+ strDHS[i] + '</td><td>'
											+ nysResult[i] + '</td><td>'
											+ nlsResult[i] + '</td></tr>';
								}
							$(".ttTable").html(strHtml4Table);
							//chartObj.series[0].setData([35.1,36,37,35,36,37,39,38,36,37,39,37,37,35,36,37,37,37,37,35  ,35,36,37,35,36,37,39,38,36,37,39,37,37,35,36,37,37,37,37,35,37,37,37,35,37,37,37,35]);
							//chartObj.xAxis[0].setCategories(["15:10","","","","15:10","","","","15:10","","","","15:10","","","","15:10","","","","15:10","","","","15:10","","","","15:10","","","","15:10","","","","15:10","","","","15:10","","","","15:10","","15:10",""]);
							$("#day1").css("display", "none");
							$("#day2").css("display", "none");
							if (tempTimer) {
								clearTimeout(tempTimer);
							}
							var prototype = curbed;
							tempTimer = setTimeout(
									function() {
										var left = prototype.offsetLeft;
										var right = getClientWidth()
												- prototype.offsetLeft
												- prototype.offsetWidth;
										var top = prototype.offsetTop;
										var bottom = getClientHeight()
												- prototype.offsetTop;
										var infoLeft = 0;
										if (left > right) {
											infoLeft = left
													- $(".bedmoreinfo").width();
										} else {
											infoLeft = left
													+ prototype.offsetWidth;
										}
										$('.modelbg').show();
										$(".bedmoreinfo").css(
												{
													"left" : getClientWidth()
															/ 2 - 470 + "px",
													"top" : getClientHeight()
															/ 2 - 335 + "px"
												}).show();//.show()
										if (data.times4chart) {
											var title = {
												text : data.dates4Chart[0],
												style : {
													color : "#333333"
												}
											};
											chartObj.setTitle(title);
										}

									}, 500)
						}

					})
			return;
			//*****************************************************************
			//chartObj.xAxis[0].setCategories(nowaboutinfo.times);
			chartObj.xAxis[0].setCategories(nowaboutinfo.times4chart);
			//chartObj.series[0].setData(nowaboutinfo.degrees);
			chartObj.series[0].setData(nowaboutinfo.degrees4chart);
			//chartObj.series[0].setData([35,36,37,35,36,37,39,38,36,37,39,37,37,35,36,37,37,37,37,37,37,37,37,37]);
			//chartObj.series[0].setData([35.1,36,37,35,36,37,39,38,36,37,39,37,37,35,36,37,37,37,37,35  ,35,36,37,35,36,37,39,38,36,37,39,37,37,35,36,37,37,37,37,35,37,37,37,35,37,37,37,35]);
			startHour = nowaboutinfo.times;
			startHour = 2;
			if (startHour == null || startHour == undefined)
				startHour = 2;
			//****************************************************如果温度数据数量不够一天则显示一天的日期
			if (nowaboutinfo.degrees)
				if (nowaboutinfo.degrees.length > 0
						&& (startHour + (nowaboutinfo.degrees.length - 1) * 2) <= 24) {
					$("#day2").css("display", "none");
					$("#day1").css("width", "600px");

				} else {
					$("#day2").css("display", "inline-block");
					$("#day1").css("width", "300px");
				}
			$("#day1").css("display", "none");
			$("#day2").css("display", "none");
			//****************************************************

			if (tempTimer) {
				clearTimeout(tempTimer);
			}
			var prototype = curbed;
			tempTimer = setTimeout(function() {
				var left = prototype.offsetLeft;
				var right = getClientWidth() - prototype.offsetLeft
						- prototype.offsetWidth;
				var top = prototype.offsetTop;
				var bottom = getClientHeight() - prototype.offsetTop;
				var infoLeft = 0;
				if (left > right) {
					infoLeft = left - $(".bedmoreinfo").width();
				} else {
					infoLeft = left + prototype.offsetWidth;
				}
				$('.modelbg').show();
				$(".bedmoreinfo").css({
					"left" : getClientWidth() / 2 - 370 + "px",
					"top" : getClientHeight() / 2 - 335 + "px"
				}).show();//.show()
			}, 500)
		}
		//温度折线图相关
		$(function() {
			chartObj = new Highcharts.Chart({
				chart : {
					spacingTop : 0,
					renderTo : 'container',
					//plotShadow:true,
					//backgroundColor:'green'
					defaultSeriesType : 'area' //图表类别，可取值有：line、spline、area、areaspline、bar、column等
				},
				title : {
					text : '',
				},
				//subtitle: null,
				scrollbar : {
					enabled : false
				},

				xAxis : {
					tickmarkPlacement : 'on',//'on',
					tickInterval : 1,
					minorTickInterval : 0.1,
					gridLineWidth : 2,
					max : 20,
					min : 0,
					labels : {
						step : 1
					}
				//tickPixelInterval: 100,
				//tickWidth:20
				/* labels:{
					formatter:function(){
						if((this.value*2+startHour)>24){
							return (this.value*2+startHour)-24 +':45';
						}else{
							return this.value*2+startHour+':45' ;
						}

					}
				} */
				},
				yAxis : [ {
					labels : {
						format : '{value}',//mmHg
						style : {
							color : '#89A54E'
						}
					},
					title : {
						text : 'NY',
						style : {
							color : '#89A54E'
						}
					},
					minorTickInterval : 1,
					tickInterval : 500,
					minorGridLineWidth : 2,
					gridLineWidth : 2,//副格线的宽度
					labels : {
						formatter : function() {
							return this.value;
						}
					},
					min : 0,
					max : 3000, //显示的最大值
					maxPadding : 2,
				}, { //第2个Y轴，序号为1
					labels : {
						format : '{value}',//mmHg
						style : {
							color : '#89A54E'
						}
					},
					title : {
						text : 'NL',
						style : {
							color : '#89A54E'
						}
					},
					minorTickInterval : 1,//"auto"
					tickInterval : 500,
					minorGridLineWidth : 1,
					gridLineWidth : 2,//副格线的宽度
					labels : {
						formatter : function() {
							return this.value;
						}
					},
					min : 1,
					max : 3000, //显示的最大值
					maxPadding : 2
				} ],
				/* tooltip : {
					valueSuffix : '°C'
				}, */
				legend : {
					enabled : false
				},
				exporting : {
					enabled : false
				},
				series : [ {
					name : 'NY',
					yAxis : 0,
					data : [],//35,36,37,35,36,37,39,38,36,37,39,37,37
					tooltip : {
						valueSuffix : 'mL'
					}
				}, {
					name : 'NL',
					yAxis : 1,
					data : [],//35,36,37,35,36,37,39,38,36,37,39,37,37
					tooltip : {
						valueSuffix : 'mL/h'
					}
				} ],
				credits : {
					enabled : false
				}
			});
		});

		function checkNum(obj) {
			//检查是否是非数字值
			if (isNaN(obj.value)) {
				obj.value = "";
			}
			if (obj != null) {
				//检查小数点后是否对于两位
				if (obj.value.toString().split(".").length > 1
						&& obj.value.toString().split(".")[1].length > 2) {
					alert("小数点后多于两位！");
					obj.value = "";
				}
			}
		};
		function fillNumOnly(obj) {
			var str = obj.value;
			if (str.trim() == "")
				return;
			if (str.length == 1 && str == "0") {
				obj.value = nowpage;
				return;
			}
			if (/[^0-9]/g.test(str)) {
				obj.value = str.substr(0, str.length - 1);
			}
		}
	</script>
	<div class="changeBedDialog">
		<!-- <div id="container" style="width: 650px; height: 400px; margin: 10px  auto 0px auto; "></div> -->
		<div style="width: 280px; height: 34px;margin:26 20 0 20;">
		<span  style="margin-left:0px;font-weight: bold; font-size: 18px; color: #3CB397">转科室</span>
		<hr style="width: 280px; height: 1px; border: none; border-top: 1px solid #3CB397;" />
	    </div>
		<div style="margin:10px;">
		<span style="margin:10px;margin-left:30px;font-size: 14px;color:#666666;">请选择科室：</span><select id="selDepartment" onchange="InitBedsByDepartment();" style="width:160px;"></select>
		<br>
		</div>
		<div style="margin:10px;">
		<span style="margin:10px;margin-left:30px;font-size: 14px;color:#666666;">请选择床位：</span><select id="selBed" style="width:160px;"></select>
		</div>
		<!-- <div style="margin:10px;">
		<div style="padding:5px;"><input type="button" onclick="sureChangeDepartment();" value="确认"><input type="button" onclick="$('.changeBedDialog').hide();$('.modelbg').hide();" value="关闭"></div>
		</div> -->
		<div onclick="$('.changeBedDialog').hide();$('.modelbg').hide();" style="cursor:pointer;width:80px;height:20px;border-radius: 15px;text-align:center;font-size:14px;color:#666666;border:1px solid #666666;
				position:relative;margin-left:122px;margin-top:26px;padding-top:4px;">关闭</div>
			<div id="yes33" onclick="sureChangeDepartment()" style="cursor:pointer;width:80px;height:20px;border-radius: 15px;text-align:center;font-size:14px;color:#3CB397;border:1px solid #3CB397;
				position:relative;margin-left:212px;margin-top:-26px;padding-top:4px;float:left">确认</div>
	</div>
	<div class="modelbg"></div>
	<div class="addconcentratorbox" style="height:200px">
		<div style="width: 280px; height: 34px;margin:26 20 0 20;">
		<span class="title4Concentrator" style="margin-left:0px;font-weight: bold;float:left; font-size: 18px; color: #3CB397">添加集中器</span>
		<hr style="width: 280px; height: 1px; border: none; border-top: 1px solid #3CB397;" />
	    </div>
		<div class="text" >
			<table class="persontab" style="margin-right:30px;">
				<tr><td style="text-align:right;padding-right:30px;font-size: 14px;color:#666666;"><font color="red">*&nbsp;</font>病床ID:</td><td><input class="bedid4Concentrator" type="text"></td></tr>
				<tr><td style="text-align:right;padding-right:30px;font-size: 14px;color:#666666;">集中器ID:</td><td><input class="concentratorNo" onkeyup="value=value.replace(/[^0-9a-fA-F]/g,'')" type="text" maxlength="12"></td></tr>
			</table>
		</div>
		<div onclick="$('.modelbg').hide();$('.addconcentratorbox').hide();" style="cursor:pointer;width:80px;height:20px;border-radius: 15px;text-align:center;font-size:14px;color:#666666;border:1px solid #666666;
				position:relative;margin-left:122px;margin-top:32px;padding-top:4px;">关闭</div>
			<div id="yes33" onclick="$('.modelbg').hide();sureAddConcentrator();" style="cursor:pointer;width:80px;height:20px;border-radius: 15px;text-align:center;font-size:14px;color:#3CB397;border:1px solid #3CB397;
				position:relative;margin-left:212px;margin-top:-26px;padding-top:4px;float:left">确认</div>
		<!-- <a href="javascript:void(0)" class="" onclick="$('.modelbg').hide();$('.putbedidbox').hide();addbed(nowaddBed);">确认</a><a href="javascript:void(0)" class="" onclick="$('.modelbg').hide();$('.putbedidbox').hide();">关闭</a> -->
	</div>
	
	<div class="putbedidbox" style="height:170px">
		<div style="width: 280px; height: 34px;margin:26 20 0 20;">
		<span style="margin-left:0px;font-weight: bold;float:left; font-size: 18px; color: #3CB397">添加床位</span>
		<hr style="width: 280px; height: 1px; border: none; border-top: 1px solid #3CB397;" />
	    </div>
		<div class="text" >
			<!-- <div class="title">请填写病床ID
			</div> -->
			<table class="persontab" style="margin-right:30px;">
				<tr><td style="text-align:right;padding-right:30px;font-size: 14px;color:#666666;"><font color="red">*&nbsp;</font>病床ID:</td><td><input id="id4UpConcentrator" type="hidden"><input class="addbedid" type="text"></td></tr>
				<tr style="display:none"><td style="text-align:right;padding-right:30px;font-size: 14px;color:#666666;">集中器ID:</td><td><input class="concentratorNo" onkeyup="value=value.replace(/[^0-9a-fA-F]/g,'')" type="text" maxlength="12"></td></tr>
			</table>
		</div>
		<div onclick="$('.modelbg').hide();$('.putbedidbox').hide();" style="cursor:pointer;width:80px;height:20px;border-radius: 15px;text-align:center;font-size:14px;color:#666666;border:1px solid #666666;
				position:relative;margin-left:122px;margin-top:-12px;padding-top:4px;">关闭</div>
			<div id="yes33" onclick="$('.modelbg').hide();addbed(nowaddBed);" style="cursor:pointer;width:80px;height:20px;border-radius: 15px;text-align:center;font-size:14px;color:#3CB397;border:1px solid #3CB397;
				position:relative;margin-left:212px;margin-top:-26px;padding-top:4px;float:left">确认</div>
		<!-- <a href="javascript:void(0)" class="" onclick="$('.modelbg').hide();$('.putbedidbox').hide();addbed(nowaddBed);">确认</a><a href="javascript:void(0)" class="" onclick="$('.modelbg').hide();$('.putbedidbox').hide();">关闭</a> -->
	</div>
		<div class="bedmoreinfo">
			<div style="width: 950px; height: 34px; margin: 26 20 0 20;">
				<span id="titie4ChartForm"
					style="margin-left: 0px; font-weight: bold; font-size: 18px; color: #3CB397">尿液监控详情</span>
				<hr
					style="width: 950px; height: 1px; border: none; border-top: 1px solid #3CB397;" />
			</div>
			<div id="maincontent4chart" style="margin: 10px; width: 950px; height: 570px;">
			<div style="float:left;">
				<div id="container" style="width: 700px; height: 440px; margin: 0px auto 0px auto;"></div>
				<a class="PreviousDay" href="javascript:void(0);" onclick="PreviousDay()"></a>
				<a class="NextDay" href="javascript:void(0);" onclick="NextDay()"></a>
				<div style="width: 700px; top: -15px; left: 17px; position: relative; font-size: 12px; height: 16px; text-align: center">
					<div id="day1" style="border: solid 1px #ccc; display: inline-block; width: 300px; border-right: none">2015.11.18</div>
					<div id="day2" style="border: solid 1px #ccc; display: inline-block; width: 300px;">2015.11.19</div>
				</div>
				<div class="personid" style="margin-top:-38px"></div>
				<div style="width:700px;height:26px;margin-top:10px;">
					<!-- <div onclick="showPrint()" style="width:120px;height:24px;padding-top:4px;float:left;margin-right:10px;cursor:pointer;border-radius: 14px;text-align:center;font-size:14px;color:#3CB397;border:1px solid #3CB397;">打印体温表</div> -->
					<div onclick="patientOut()" style="width:80px;height:24px;padding-top:4px;float:left;margin-right:10px;cursor:pointer;border-radius: 14px;text-align:center;font-size:14px;color:#3CB397;border:1px solid #3CB397;">出院</div>
					<div onclick="changeDepartment();" style="width:90px;height:24px;padding-top:4px;float:left;margin-right:10px;cursor:pointer;border-radius: 14px;text-align:center;font-size:14px;color:#3CB397;border:1px solid #3CB397;">转科室</div>
					<div><select class="select4Time" onchange="ChangeTime()"><option value="5">5分钟</option><option value="10">10分钟</option><option value="30">30分钟</option><option value="60">1小时</option><option value="120">2小时</option></select></div>
					<!-- <div onclick="$('.bedmoreinfo').hide();$('.modelbg').hide();" style="width:80px;height:24px;padding-top:4px;float:right;cursor:pointer;border-radius: 14px;text-align:center;font-size:14px;color:#666666;border:1px solid #666666;">关闭</div> -->
					<!-- <input type="button" class="showinfo" onclick="" value="打印体温表">
					<input type="button" class="listenbt" onclick="patientOut()" value="出院">
					<input type="button" onclick="changeDepartment();" value="转科室">
					<input type="button" onclick="$('.bedmoreinfo').hide();$('.modelbg').hide();" value="关闭"> -->
				</div>
			</div>
			
			<!-- 体温表格 -->
				<div id="tablecontainer"  style="overflow-x:hidden;overflow-y:auto;margin:15 0 0 0px;float:right;width:240;height: 510px;"  >
					
					<table class="ttTable">
					<!-- <thead style="position:absolute;top:58px"><td style="width:100px">时间</td><td style="width:100px">温度</td></thead>
						<tr><td>123123</td><td>36.66</td></tr> -->
					</table>
				</div>
				<div onclick="$('.bedmoreinfo').hide();$('.modelbg').hide();" style="margin-top:10px;width:80px;height:24px;padding-top:4px;float:right;cursor:pointer;border-radius: 14px;text-align:center;font-size:14px;color:#666666;border:1px solid #666666;">关闭</div>
			</div>
			
		</div>
		<div class="addpersonbox">
		<div style="width: 320px; height: 34px;margin:26 20 0 20;">
		<span id="titie4AddOrUpdatePatient" style="margin-left:0px;font-weight: bold; font-size: 18px; color: #3CB397">添加患者</span>
		<hr style="width: 320px; height: 1px; border: none; border-top: 1px solid #3CB397;" />
	    </div>
	    <!-- <span style="display:block;position:absolute;top:80px;left:50px;font-size:16px;color:#000;font-weight:bold;">患者信息</span> -->
	    <table  style="text-align:right;width:290px;font-size: 14px;color:#666666;margin-left:0px;margin-top:10px">
				<tr><td><font color="red">*&nbsp;</font>病人姓名</td><td><input id="patientid" type="hidden"><input name="name" type="text"></td></tr>
				<tr><td><font color="red">*&nbsp;</font>性别</td><td>&nbsp;<input name="sex" style="width:13px;height:13px;" type="radio" value="男"> &nbsp;男 &nbsp;&nbsp;<input name="sex" type="radio" style="width:13px;height:13px;" value="女">&nbsp;女</td></tr>
				<tr><td><font color="red">*&nbsp;</font>年龄</td><td><input name="age" type="text" maxlength="3" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')"></td></tr>
				
				<tr><td><font color="red">*&nbsp;</font>设备号码</td><td><input name="cardname" onkeyup="value=value.replace(/[^0-9a-fA-F]/g,'')" type="text" maxlength="12"></td></tr>
				<tr><td><font color="red">*&nbsp;</font>少尿报警</td><td><input id="lowNY" name="lowNY" maxlength="5" onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')"  type="text"><!-- <select name="lowc"><option>35</option><option>36</option><option>37</option><option>38</option><option>39</option></select> ~ <select name="highc"><option>41</option><option>40</option><option>39</option><option>38</option><option>37</option></select> --></td></tr>
				<tr><td><font color="red">*&nbsp;</font>多尿报警</td><td><input id="highNY" name="highNY" maxlength="5" onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,'')" type="text"></td></tr>
				<tr><td><font color="red">*&nbsp;</font>采样时间</td><td><input name="samplingTime" id="samplingTime" style=" cursor: pointer" class="Wdate" type="text"
				onClick="WdatePicker({dateFmt:'HH:mm',readOnly:false})"></td></tr>
				<tr><td><font color="red">*&nbsp;</font>病床号</td><td><input id="bedid" name="bedid" type="text"><input id="idofbed" name="idofbed" type="hidden"></td></tr>
				<tr><td><font color="red">&nbsp;</font>入院时间</td><td><input name="roomtime" id="startTime" style=" cursor: pointer" class="Wdate" type="text"
				onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:false})"></td></tr>
				<tr><td>病案号码</td><td><input name="sicknum" type="text"></td></tr>
				<tr><td>医师诊断</td><td><input name="sickname" type="text"></td></tr>
				<tr><td>主管医生</td><td><input name="doctor" type="text"></td></tr>
				<tr><td>身份证</td><td><input name="personid" type="text" maxlength="18" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')"></td></tr>
				<tr><td>住址</td><td><input name="address" type="text"></td></tr>
				<tr><td>就医类型</td><td><input name="sicktype" type="text"></td></tr>
			</table>
			<div onclick="cancelAddPatient()" style="cursor:pointer;width:80px;height:20px;border-radius: 15px;text-align:center;font-size:14px;color:#666666;border:1px solid #666666;
				position:relative;margin-left:172px;margin-top:12px;padding-top:4px;">关闭</div>
			<div id="yes33" onclick="sureAddPersonCom()" style="cursor:pointer;width:80px;height:20px;border-radius: 15px;text-align:center;font-size:14px;color:#3CB397;border:1px solid #3CB397;
				position:relative;margin-left:262px;margin-top:-26px;padding-top:4px;float:left">确认</div>
	</div>
</body>
</html>